Jump to content

Javascript Popup


sean04

Recommended Posts

Hey,

 

So I have this:

 

echo "<a href=\"javascript:window.open('page.php','name1','height=320,width=240');\">pop-up</a>";

 

In Chrome, the popup works great, in IE the pop up take a while to popup and then the page itself where the popup link was goes white and says [Object].

 

Any ideas? Not sure why it doesn't work in IE.

Link to comment
https://forums.phpfreaks.com/topic/199512-javascript-popup/
Share on other sites

Your link is not properly formed. the HREF attribute indicates that a new page should be opened.  When the window.open() funtion runs, it returns an object, and that is what the white page is telling you.  I'm not sure you can accomplish this with HREF.  You could use the ONCLICK attribute (instead of the HREF) but then you might not get the visual indicators that it is a link (use CSS to change the style of that link).

<a onclick="window.open('page.php','name1','height=320,width=240');">pop-up</a>

Link to comment
https://forums.phpfreaks.com/topic/199512-javascript-popup/#findComment-1047164
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.