IE8 Var W= Window.Open() - "Message: Invalid Argument."

ie8 var w= window.open() - Message: Invalid argument.

This is an old posting but maybe still useful for someone.

I had the same error message. In the end the problem was an invalid name for the second argument, i.e., I had a line like:

   window.open('/somefile.html', 'a window title', 'width=300');

The problem was 'a window title' as it is not valid. It worked fine with the following line:

   window.open('/somefile.html', '', 'width=300');

In fact, reading carefully I realized that Microsoft does not support a name as second argument. When you look at the official documentation page, you see that Microsoft only allows the following arguments, If using that argument at all:

  • _blank
  • _media
  • _parent
  • _search
  • _self
  • _top

window.open is throwing invalid argument error in IE

Oh wow, I've opened another tab, which asked me my credentials again, after entering it, the same exact link just worked. It seems like the session timeout or something but still showed me the page between loads. If anyone encounters this error and none of the comments above work, try opening a new tab!!
Thank you all for trying to resolve my issue.

window.open throws invalid argument in IE7-8-9b

IE disallows spaces and other special characters in window name (the second argument). You need to remove them before passing as argument.

Replace

"sharewindow"+tpl.substr(6,15)

by

"sharewindow"+tpl.substr(6,15).replace(/\W*/g, '')

so that you end up with

window.open(tpl,"sharewindow"+tpl.substr(6,15).replace(/\W*/g, ''),"width=640,height=480");

(that's basically a regex replacement which says "replace every sequence of non-aplhabetic character by nothing")

Live demo here (configure if necessary your popup blocker)

window.open error only in IE - Invalid argument

The window name shouldn't have a space. Try EditEvents.

Window.open Invalid Argument in Javascript

Internet Explorer insists that window names be valid identifiers. Your name has a space in it. Try "My_Notification" instead.



Related Topics



Leave a reply



Submit