Mozilla document.createElement('script') Blank page

M

mmcc128

When I call this...

-------------------------
function funcWinTopJS(){
var s = document.createElement('script');
s.type = "text/javascript";
s.src = "Javascript/Master.asp";
document.documentElement.appendChild(s)
}
----------------------------

The window goes blank in Mozilla. It works great in IE 6. Any clue?
Thanks, inadvance.

MM
 
M

Martin Honnen

When I call this...

-------------------------
function funcWinTopJS(){
var s = document.createElement('script');
s.type = "text/javascript";
s.src = "Javascript/Master.asp";
document.documentElement.appendChild(s)

A <script> element should be a descendant of the <head> or <body> but
not a child of <html> so make that
document.body.appendChild(s);

The window goes blank in Mozilla. It works great in IE 6. Any clue?

Probably does not result from the function itself but the way you call
the function.
Where/How do you call the function?
 
M

mmcc128

Well, it was in a page with frames - and it was at the top within the
script tags. I've since gotten around it - but never got it to work.
The issue is gone - but Ive found that referencing "document" when
using Mozilla is very important.

We are jsut starting to make our app cross browser compliant (only IE
before) and...well, its not fun. IE is too forgiving and makes us lazy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top