I hate these types of bugs.
I have just wasted an hour of my day trying to figure this out. It works in Mozilla as expected and I havent tried IE6 but IE7 threw a strange error.
I was trying to check if a certain string was in the url of the window that opened a pop-up.
The code I was using that failed was:
I tried everything I could think of to try and test and re-check my code etc. I stripped it all back and thought maybe it was to do with string types so did the following:
Bingo...it worked. Turns out when I concatenate the str variable with an empty string, it solved the problem.
Working pretty well right now!