471,316 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

Mozilla document.createElement('script') Blank page

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

Jul 23 '05 #1
2 7806


mm*****@gmail.com wrote:
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?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
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.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by me | last post: by
2 posts views Thread by Ola Fjelddahl | last post: by
1 post views Thread by ebrandmark | last post: by
7 posts views Thread by Joseph Scoccimaro | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.