Chris Bornhoft
Chris Bornhoft

Reputation: 4291

window.open error only in IE - Invalid argument

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?

Upvotes: 11

Views: 11144

Answers (2)

Dung Nguyen
Dung Nguyen

Reputation: 11

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.

Upvotes: 1

Pekka
Pekka

Reputation: 449385

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

Upvotes: 32

Related Questions