Window.Open Call Generates Invalid Argument Error in IE

Mindwatering Incorporated

Author: Tripp W Black

Created: 01/09/2008 at 05:42 PM


Notes Developer Tips

Have call which has error. IE is generating an error with message as "Invalid Argument".

Possible Solutions:
Check the following. This issue has been one of the following:
1. The window name has a space in it. The window name is the second parameter.
e.g., 'some name', winoptions);

2. The URL / URI was passed as one variable concatenated via computed text which was passed to the function at run time. This looks correct in the source but still blows up in IE 6. This seems to be an occasional IE 6 bug. Instead of passing the URL completed, which would normally be better code design, pass it in segments and recombined w/in the function. The URL is the first parameter.
e.g."/" + dbpath + "/dnelement", winnm, winoptions);

3. One of the options has a space. This blows up early IE versions. Concatenate the options w/o spaces between the = and , characters.
e.g., somenm, 'width=200,height=100');

4. In IE6, I had one case where the was being called within the a link's onClick. The onClick did NOTHING and the error message was slightly different each refresh on where in the code. Moving the to a function ended up fixing the issue. It seemed to have been caused by the fact that the URL was pretty long, and there was a confirm (if) message that was long, too. The source text for those two lines were too much for IE 6 to "parse". By taking out one line and calling it via a function, IE seemed to behave.

previous page