Jump to content

Problem With Popup In Ie


kokeroulis
 Share

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');

Edited by Sckewi
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...