473,597 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mozilla document.create Element('script ') Blank page

When I call this...

-------------------------
function funcWinTopJS(){
var s = document.create Element('script ');
s.type = "text/javascript";
s.src = "Javascript/Master.asp";
document.docume ntElement.appen dChild(s)
}
----------------------------

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

MM

Jul 23 '05 #1
2 7940


mm*****@gmail.c om wrote:
When I call this...

-------------------------
function funcWinTopJS(){
var s = document.create Element('script ');
s.type = "text/javascript";
s.src = "Javascript/Master.asp";
document.docume ntElement.appen dChild(s)
A <script> element should be a descendant of the <head> or <body> but
not a child of <html> so make that
document.body.a ppendChild(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
11385
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 __________________________________________________________________ k zobra
2
2202
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
2816
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 like I want it to. What's happening is, if I do a document.write(scriptcall), the script loads, although sometimes very slowly... (?). Any inline code is executed (I used an alert to verify that the script is loading). But all the previous...
1
2596
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 page). The DEFER method won't work because the document.write just starts a new page. I was hoping to leave a DIV where the result should end up. Then at the end of the page create a child of this DIV or another DIV that lays on top of this...
7
3312
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 the header section. It ends up not adding anything to the document. I am currently getting no errors from the javascript panel in firefox. Here is the code I am using: HeadTag = document.getElementsByTagName("head"); var scriptElement =...
17
2759
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 language="javascript" src="../scripts/base.js" type="text/javascript" /> } </script> Obviously this would cause n error but this would give you an idea of what I'm looking to do. I know I can do this with a simple include but...
3
9342
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 tutorial that made it look fairly simple, but I can not get it to work so far. Here's the code for the DIV: <div id="myDepartmentDiv" class="myDepartmentDiv"> <span>
2
1948
by: sylver | last post by:
Hi, Following the discussion that can be found here: http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/fda122b27c008266/909da813c8527282?lnk=gst&q=+dynamically+add+a+script+source&rnum=1#909da813c8527282 I modified mine and was trying to launch an alert message inside the dynamically added script . My sample codes ================================================
3
2582
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.. http://www.integrityads.net/fashions/collection.htm Also it is not resolution compatible,i.e. alignment totally messed up when i increased the resolution.Please suggest. Code is as follows:- <HTML><HEAD> <meta http-equiv="Content-Language" content="en-us"> <TITLE>Collections</TITLE>...
0
7959
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8263
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3876
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3917
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2393
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1492
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.