473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 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 7927


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: me | last post by:
Hey all, is it possible to make a vari =new Script(); object? like when you do new Image(); or new Iframe()? Cheers. me __________________________________________________________________...
2
by: Ola Fjelddahl | last post by:
hi. I load a script dynamically and it works * everytime with IE6. * sometimes! with Mozilla1.5 <- makes me curious * never with Opera7.11 all tests on WindowsXP. With "sometimes" I mean
4
by: Razzbar | last post by:
I need to be able to conditionally load a remote script, using the "<script src=..." syntax. Or some other way. I've seen people writing about using the document.write method, but it's not working...
1
by: ebrandmark | last post by:
I am trying to load a SCRIPT SRC tag that will result in a document.write into a specific location in my web page but not call for the SCRIPT SRC until the end of the page (so as not to delay the...
7
by: Joseph Scoccimaro | last post by:
Currently I am trying to use JavaScript within greasemonkey to dynamically put a menu at the top of each page. I am running in to trouble when I try to append a node representing a script tag to...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
3
by: Tarik Monem | last post by:
Hey everyone, I'm trying to add javascript tags into a specific DIV so that I can use a variable to change out the script tags source and use it as a type of "javascript-include" I found a...
2
by: sylver | last post by:
Hi, Following the discussion that can be found here:...
3
by: PrabodhanP | last post by:
I have CSS based mouseover scrolling for divContent embeded in my webpage.It works fine in IE,but not working in mozilla-FF. It is located at the location.....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.