Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 929
Chris Bornhoft Avatar asked Apr 26 '11 13:04

Chris Bornhoft


2 Answers

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

like image 192
Pekka Avatar answered Nov 09 '22 11:11

Pekka


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.

like image 1
Dung Nguyen Avatar answered Nov 09 '22 11:11

Dung Nguyen