View Single Post
Old 09-24-2012, 10:21 PM   PM User | #3
hadoob024
New Coder

 
Join Date: Apr 2008
Posts: 43
Thanks: 5
Thanked 0 Times in 0 Posts
hadoob024 is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
Code makes no sense.

Code:
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.
window.location='index.php?module=Patient_Procedure&action=genMFGPO'&pomode=create&kindofpo=Z';

// 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?
window.open(\'index.php?module=Patient_Procedure&action=genMFGPO&pomode=preview','poverifywin','width=1250,height=1000,status=0,resizable=1,scrollbars=1,toolbar=0,menubar=0,location=0')
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 window.location 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.

Last edited by hadoob024; 09-24-2012 at 10:36 PM..
hadoob024 is offline   Reply With Quote