Monday, January 04, 2010

The Saga

A while back I encountered a strange problem with Javascript function. The offending Javascript looked like this:'someurl.aspx', 'My Window');

The code seemed to work fine in Firefox but I got an error when trying to evaluate the expression in Internet Explorer 7. I went crazy trying to figure out what was wrong with my code and soon found the space ' ' in the second parameter ('My Window') was causing the problem. If replaced the space with an underscore (i.e., 'My Window' -> 'My_Window') the error disappeared. I noticed that if I would've read the Mozilla JS documentation ( I would've seen the warning about not putting a space in the window name but I didn't. However the issue was related to IE7 I turned to Microsoft's documentation ( and it should be no surprise that the no-space-in-the-window-name isn't mentioned anywhere.

No comments: