Maybe a typo, but it should be
myurl.indexOf
lowercase i.
And locationis an object , so you want:
var myurl = window.location.href;
(and all other things say in the comments and other answers;))
Update: To find out what properties an object has, just enter in this case window.locationin the console:

source
share