PDA

View Full Version : Dynamic PopUp resulting in 404 error


Pixie
08-12-2002, 11:38 PM
Hello:

I'm wondering if someone out there could provide me with some 'hints' as to why this may be occuring.

I have a simple, dynamically generated popup window that displays test results for an online quiz (user clicks 'evaluate' button on form to initiate).

The script works fine in IE, and will also work in Netscape IF I am running the script from my local hard drive. However, if I move the files to our server, the popup displays a 404 error in Netscape. It continues to function properly in IE - even on the server.

I'm testing using Netscape 4.61 - which is a client requirement.

Any ideas as to why I would get a 404 running the script from the server but not when running locally?

The popup does not reference any other files, it dynamically generates the test results in the popup window.

(for example...)

var scoreWin = window.open("","","height=500, width=300, scrollbars")
scoreWin.document.open()
scoreWin.document.write(resultsHTML)
scoreWin.document.close()


Any thoughts/suggestions on how to resolve would be appreciated.

Thx.

Algorithm
08-13-2002, 04:24 AM
Try getting rid of the document.open() call. The window.open() routine opens the page for editing, so document.open() is redundant. I don't think you need document.close() either.

If that doesn't solve it, I don't know what to tell you. I have similar scripts that work just fine in Netscape 4.

adios
08-13-2002, 04:47 AM
window.open() doesn't open the document stream (except to a specified url), but document.write() does. You definately need .close() to flush the buffer. Maybe:

var scoreWin = window.open("about:blank","","height=500, width=300, scrollbars")

...although this is rumored to be an occasional bug fix for IE.

Pixie
08-13-2002, 06:33 PM
Nope - neither of these made any difference (or worse).

I'm getting more confused by the minute.

As I said, the script works just fine in BOTH browsers IF I am running it from my local hard drive. It is only when I attempt to run it from the server that it breaks in Netscape. IE still functions as it should.

I thought perhaps it was related to external .js files being used, so I copy/pasted all the javascript into the head of the html page. But, it still pops up with a 404 error and freezes Netscape.

Ugh!

adios
08-13-2002, 06:54 PM
Can't find any technote on it...ugh is right.

How about:

var scoreWin = window.open("javascript:opener.resultsHTML","","height=500, width=300, scrollbars");

I'm assuming 'resultsHTML' is global; if not, just declare it outside any function (resultsHTML = '') and undeclare it inside. Sometimes letting .open() handle the document.load - even if it's a string - helps. Ugh.