0
function printThis(patientId) {
    window.open("print.aspx?ID=" + patientId, "Site", "menubar=0,resizable=1,width=800,height=900");
}

works fine with firefox and chrome but not with IE (9.0 at least) - "invalid argument", what's the issue and what's the solution?

Thanks in advance.

Govind Malviya
  • 13,627
  • 17
  • 68
  • 94
Martin
  • 13
  • 1
  • 4
  • printThis? Are you doing some popup based printer friendly version instead of using a print media stylesheet? – Quentin May 03 '11 at 13:42
  • Duplicate of http://stackoverflow.com/q/710756/97658 – Myra May 03 '11 at 13:42
  • @David - yes, print media CSS is not applicable in this case. – Martin May 03 '11 at 14:03
  • 5
    Is "Site" your actual 2nd parameter? or have you simplified the code sample. In IE, if you have spaces or a dash in the name (2nd parameter) it will throw an `invalid argument` error. – scunliffe Jul 25 '11 at 16:02

2 Answers2

1

Window.open must be called from an onClick event. Otherwise Mr popup blocker will eat your window.

Coomie
  • 4,832
  • 3
  • 32
  • 44
0

Works for me (well replacing your aspx with a valid url). Are you sure the pop-up blocker is not eating your window.open ?

Jad
  • 922
  • 8
  • 14