Originally Posted by Old Pedant
Code makes no sense.
window.close(); // the CURRENT WINDOW is now closed...NO OTHER CODE can use the current window
// so this next line is meaningless, since the current window no longer exists.
// this next code might work, but it might not...
// ...because once the current window is closed where is the JS code supposed to be working?
If you want to close the current popup, that must be the *LAST* thing you do.
But what I don't understand is where the PDF file you say the middle statement opens is supposed to go if you are (a) trying to put it into the current window [which is what
will do] and (b) trying to close the current window.
That just makes no sense, at all.
By meaningless, do you mean that it won't run, because it does. The window.location does execute, it's just the final window.open() that doesn't run. I didn't write this, just trying to fix it so that it runs in IE. This code runs fine in Firefox.
Also, I'm not displaying the PDF, just generating it and saving it locally.