Jump to content

Problem With Popup In Ie


kokeroulis

Recommended Posts

Hello i have made a popup for my website.In all the browsers exept the ie it works fine.But ie tries to download the file not to open it.The code of the popup is the following

<HEAD><script LANGUAGE="JavaScript">function popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, 'New_Window', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=500,height=500');");}</script><BODY onLoad="java script:popUp('form.php')">

Link to comment
Share on other sites

Guest FirefoxRocks

Try simplifying your code first by taking out the extra stuff to see if it is the problem:

<!DOCTYPE html><head><title>Test JavaScript Popup</title><script type="text/javascript">function popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, 'New_Window')");}</script></head><body onload="popUp('form.php')"></body>

Maybe the problem was the java script: thing in the onload function. It could also be a popup blocker issue. What version of IE are you using?

Link to comment
Share on other sites

I think that IE doesn't like underscores for the window name.Try:window.open(URL, 'newWindow', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=500,height=500');Edit: Oh and drop the tags for the window name:window.open(URL, 'newWindow', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width=500,height=500');

Link to comment
Share on other sites

Hmm I've tested it locally replacing URL with 'test.txt' and creating a file called text.txt in the same folder as the web-page running the script. Seems to work for me, the only thing I had to do was remove a line break created by the forum software. Could it be that?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...