473,770 Members | 2,004 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 7953


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
11397
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
2211
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
2826
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
2604
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
3323
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
2783
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
9363
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
1957
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
2600
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
9454
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
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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,...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.