iPixel Posted January 11, 2010 Share Posted January 11, 2010 I need to find out how i can check a web URL. so for example... this website is, www.mywebsite.com so i need this to work like so : if(URL address is www.mywebsite.com) OR (URL address is www.mywebsite.com/index.php) { DO THIS } else { DO THAT } Thanks! Link to comment https://forums.phpfreaks.com/topic/188014-check-url-with-js/ Share on other sites More sharing options...
iPixel Posted January 11, 2010 Author Share Posted January 11, 2010 I got it function Check4Pop() { var myURL = window.location.href; //alert(myURL); if((myURL == "http://www.mywebsite.com/") || (myURL == "http://www.mywebsite.com") || (myURL == "http://www.mywebsite.com/index.php")) { document.getElementById("gopopup").style.display = 'block'; } else { document.getElementById("gopopup").style.display = 'none'; } } Link to comment https://forums.phpfreaks.com/topic/188014-check-url-with-js/#findComment-992611 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.