Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / August 2007



Tip: Looking for answers? Try searching our database.

window.open and IE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 31 Aug 2007 05:19 GMT
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 - 01 Sep 2007 00:30 GMT
Jeff said the following on 8/31/2007 12:19 AM:
> I have this pop up window code:
>
[quoted text clipped - 16 lines]
>   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?

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.

Signature

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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.