Click to See Complete Forum and Search --> : Script loading problem??


Helix
10-01-2003, 01:17 AM
Hello.

I'm using window.open to create a blank document and document.write to fill that document with some html.


write("<html>")
... ... ...
write("<script src=\"...\"></script>")
write("<img src=\"...\" onload=\"...\">")
... ... ...
write("</html>")


The page works fine when offline, but not from the net, so there has to be some loading problem involving the external script the page uses. IE freezes at the point where it should display the image. If I take out the script tag and the image onload event handler everything works fine.

So, please tell me if a script can be preloaded or something; I believe that's the way to go.

There's another problem with my site that is very similar to this one: a blank frame being filled with "write()". I use a script in the same way, and that script also adds html elements. Those elements just aren't displayed the first time go to the page. The second attempt is always sucessful. That's why I'm guessing that the loading of the script is faulty.

What can I do?

Fang
10-01-2003, 01:55 AM
The first problem is probably due to the path to the images being incorrect.

The second could be invalid code, but without a link/code to the page it's guesswork.
Writing to pages in this way is not to be recommended.

Helix
10-08-2003, 01:00 AM
Forget it, I fixed it using <script DEFER...