Answer the question
In order to leave comments, you need to log in
Perform an action if you are on a specific url?
if(location.href="мой url"){
alert("y");
}else{
alert("n");
};
Answer the question
In order to leave comments, you need to log in
In the first line... https://www.w3schools.com/js/js_comparisons.asp
You missed == in the first line.
This would be more correct:
if(location.href==="мой url"){
alert("y");
}else{
alert("n");
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question