error:

Uncaught TypeError: Cannot call method 'indexOf' of null (repeated 3 times)


I'm getting this error only in Chrome, not even Safari... (and not FF..... don't know about IE, can't test on IE now...)

what is this... I have never seen this before... (this error has to do with method indexOf(), but my use of it here is very conventional.... for example....

Code:
if (loc.indexOf('localhost') != -1) {
   .......
}

so what is this error....

thank you...