Hello guys, I'm new at JS, I just have a quick question, what's wrong with this code? abc = window.location; if(abc == ""){ ivir = 0; } if(ivir == 0){ alert("no url!") }else{ alert("you are at" + abc) } Code (markup): thank you all
Try this : <script> var abc = window.location.href; if(abc.length == 0) { alert("no url!"); } else { alert("you are at :" + abc); } </script> HTML: