11

I have a simple calendar popup window come up when a date on the calendar is clicked. The code below works in Opera, FF and Chrome but not in IE6-8. It comes up with the Error on Page at the bottom and shows the error invalid argument.

<div class="day-number">1</div>
<td class="calendar-day" onclick="window.open('http://www.cal.com/admin/editevents.php?day=2&month=4&year=2011', 
'Edit Events', 'scrollbars=1,width=600,height=475');">

Could someone help me out and spot what I'm doing right but wrong according to IE?

Chris Bornhoft
  • 4,195
  • 4
  • 37
  • 55
  • 1
    possible duplicate of [window.open throws invalid argument in IE7-8-9b](http://stackoverflow.com/questions/4840369/window-open-throws-invalid-argument-in-ie7-8-9b) – Pekka Apr 26 '11 at 13:18
  • @Pekka Could be but the question is different. That question also did not come up when asking this question. – Chris Bornhoft Apr 26 '11 at 13:23
  • the comment above is created automatically by the system when one votes to close a question as a duplicate of another. It wasn't meant as an accusation that you didn't search :) But it clearly *is* a duplicate. – Pekka Apr 26 '11 at 13:24

2 Answers2

32

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

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
1
window.open(theURL,winName,features);

ex: window.open('google.com','Edit Events','width=100'); //false

window.open('google.com','EditEvents','width=100'); //True

=> Edit Events //false

EditEvents //true

=>winName doesn't have spaces.

Muhammad Hani
  • 8,476
  • 5
  • 29
  • 44