Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery if url matches

Tags:

jquery

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/

like image 476
test Avatar asked Nov 28 '25 23:11

test


1 Answers

if(window.location.href === "http://stackoverflow.com/questions/"){
    ... then to this
}
like image 138
Gabe Avatar answered Dec 01 '25 14:12

Gabe