I am unable to find the specific value in the address bar.
var str = window.location;
var x = str.search(/78203/i);
alert(x);
The code above does not return anything and actually kills anything (indicates an error), but nothing rushes to the console.
If you delete a comment, it works fine, returning a value greater than -1 (which means that it found something).
This is obviously something that I misunderstand, can someone help me?
source
share