Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

window.open and IE

4 views
Skip to first unread message

Jeff

unread,
Aug 31, 2007, 12:19:00 AM8/31/07
to
I have this pop up window code:

<script type="text/javascript">
function popUp(obj){
var win=window.open(obj.href,obj.innerHTML,"width=500,height=500");
alert('This test alert will not pop in IE');
win.focus();
return false;
}

</script>

<a href="somepage.html" onclick="return popUp(this)">Some Page</a>

That does not work in my version of IE (IE 6.0, no popup blockers).
It seems like the function returns true at the window.open without
opening a new window. Other browsers are OK.

Is there something I'm overlooking in this stupid little bit of
javascript? Or is my IE broken? Perhaps there's a cleaner way to do this?

Jeff

Randy Webb

unread,
Aug 31, 2007, 7:30:41 PM8/31/07
to
Jeff said the following on 8/31/2007 12:19 AM:

The thing you are overlooking is the space in the innerHTML of the link.
IE - rightfully - doesn't allow spaces in Window Names and errors out on
it. Firefox is getting it wrong and allowing the space.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

0 new messages