test test - 9 months ago 49
jQuery Question

jQuery if url matches

I want to reach something like this:

if(window.location.href.indexOf("http://stackoverflow.com/questions/")){
... then to this
}


but it still runs when url looks like this
http://stackoverflow.com/questions/ask/

Answer
if(window.location.href === "http://stackoverflow.com/questions/"){
    ... then to this
}