I need to be able to know if the URL contains “main.php”.
How can I do this in jQuery?
I tried this
$(function() {
if ( document.location.href.indexOf('main.php') > -1 ) {
alert('hi');
}
});
The full url would be http://www.flirtwithme.co/main.php
What’s the most efficent way to capture the main.php?
Also I’m using hash like this
with $(window).bind('hashchange')
So how can I capture main.php when it doesn’t have a hash value. This is the real question I’m after, as I have hash changing working. I want the URL alone (main.php) to be controllable.
Try: