Click to See Complete Forum and Search --> : Problem with document.writeln and popup window


rmirro
08-26-2003, 04:56 PM
Hello everyone. I'm having a problem writing html to a popup window via document.writeln.

More specifically, my code works if I initially load an HTML file in the popup window. If I load a PDF file in the popup, I seem to no longer be able to use document.writeln to manipulate the contents of the window.

Basically the idea is that many links get generated on one html page. Some of the links point to an HTML file while others point to PDF files.

If the user clicks a link, the popup window opens (ONLY if it's not already open), then loads the proper URL.

If the user clicks another link on the main html page while the popup is still open, I simply reuse the open window, generate a "loading..." message, then load the new URL in the existing popup.

Once I load a PDF in the popup, I can no longer load any other documents in that popup using the logic I have.

Is this a know issue?

I have a workaround which simply closes/re-opens the popup if a PDF is loaded, but I don't like that approach.

I can provide the code I'm using if that'll help. Just let me know.

Thanks!
-Bob

Mr J
08-26-2003, 05:21 PM
Could you post your code please

rmirro
08-27-2003, 01:48 PM
Originally posted by Mr J
Could you post your code please


Sure. I just put it up on a webserver so you can see the code in action. I stripped out much of the functionality so it's easier to focus on the problem.

The problem occurs once the PDF file is loaded into the popup window. It fails different using Mozilla 1.3 and IE 6.0, but the point is it still fails, but the point is fails in both.

Click the HTML links a couple times to see how it's supposed to work (the "loading..." message usually displays longer when I use this in my web app that hits a database, but in this case it flashes a little too quickly). Leave the popup window the entire time, as opposed to closing it before choosing each of the HTML links.

Once you load the PDF into the popup, the other HTML links no longer work in Mozilla. In IE the HTML links work, but it still doesn't function correctly.

You can see and run the code here:
http://www.microserve.net/~rmirro/popupTest.html

If you want to d/l all files, you can do that here:
http://www.microserve.net/~rmirro/popupTest.zip

Thanks!
-Bob