473,670 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically Loading JS Files

This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can't
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.create Element to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don't have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS'es?

Any and all feedback is greatly appreciated.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #1
10 2192
Randy Webb wrote:
<snip>
What I don't have is access to any browsers running on Linux
or a MAC (strictly Windows access). Can I get it tested in
browsers other than whats listed on the page, and in different
OS'es?


Assuming that you haven't changed the script since the last time we
tested this, I had a chance to try out the test script I was using last
time on a Mac a couple of weeks ago. With safari none of the methods
worked. With Mac IE 5 the innerHTML method worked but the SRC setting
method errored at the point of assigning to the - src - property and the
createElement method errored at exactly the same point.

Richard.
Jul 20 '05 #2
In article <Ep************ ********@comcas t.com>,
Randy Webb <hi************ @aol.com> wrote:
This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can't
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.create Element to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don't have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS'es?

Any and all feedback is greatly appreciated.


I am not certain what the output should look like. Could you post
screen images on your site?

I tried on MacOS 10.2.6:
Netscape 7.1 -- Got alert initial js file loaded. Got Windows table.
The last letter r in "Load It In A Layer" was slightly to the right of
the border. The black background went a few characters to the right too.
No vertical boarders were seen in heder row.

IE 5.2 -- Got alert initial js file loaded. Title row columns didn't
align up with data columns on table.

Netscape 4.77 running in classic mode. This is MacOS 9.22 virtual
machine. Results may differ in a native 9.x machine if application
access unsupported hardware devices. Netscape gave up the ghost twice.
I didn't get an alert when initailly loading the page. I did on a
reload I got alert initial js file loaded. When I clicked on Change it
in Netscape 4, I got an alert. I didn't notice any changes. Twice,
half the text in Change it in Netscape 4 text turned red and the other
blue. Clicking on this text, crashed Netscape 4.77.

Robert

Robert
Jul 20 '05 #3
Randy Webb wrote:
This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can't
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.create Element to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don't have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS'es?

Any and all feedback is greatly appreciated.


Mozilla 1.4 under Linux, only CreateElement works.
Konqueror 3.1.4 under Linux, the first page is unusable(it looks terrible
and I can't click the buttons).
Galeon 1.3.8 under Linux, only CreateElement works.

I also tested it with Lynx, but it was unusable.

--
Remove the 'dont_spam_me' and the dashes before mailing me.
Jul 20 '05 #4
Richard Cornford wrote:
Randy Webb wrote:
<snip>
What I don't have is access to any browsers running on Linux
or a MAC (strictly Windows access). Can I get it tested in
browsers other than whats listed on the page, and in different
OS'es?

Assuming that you haven't changed the script since the last time we
tested this, I had a chance to try out the test script I was using last
time on a Mac a couple of weeks ago. With safari none of the methods
worked. With Mac IE 5 the innerHTML method worked but the SRC setting
method errored at the point of assigning to the - src - property and the
createElement method errored at exactly the same point.


The script I have now is nothing more than the scripts we used before,
with each method invoked via a button, so its the same script.

Thanks.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #5
Robert wrote:
In article <Ep************ ********@comcas t.com>,
Randy Webb <hi************ @aol.com> wrote:

This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can't
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.create Element to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don't have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS'es?

Any and all feedback is greatly appreciated.

I am not certain what the output should look like. Could you post
screen images on your site?


I know the layout of the page needs some work to get it to display
properly, my apologies on that one.
I tried on MacOS 10.2.6:
Netscape 7.1 -- Got alert initial js file loaded. Got Windows table.
The last letter r in "Load It In A Layer" was slightly to the right of
the border. The black background went a few characters to the right too.
No vertical boarders were seen in heder row.
Can you go back and click each black button and let me know which ones
give you an alert? When you click a button, one of two things will
happen. You either get an alert or you dont. If you get the alert, then
it worked for that method.

I added some rudimentary directions to the page. I will try to add some
more tomorrow when I have time. I probably should have waited until I
had the directions on the page before posting :(
IE 5.2 -- Got alert initial js file loaded. Title row columns didn't
align up with data columns on table.

Netscape 4.77 running in classic mode. This is MacOS 9.22 virtual
machine. Results may differ in a native 9.x machine if application
access unsupported hardware devices. Netscape gave up the ghost twice.
I didn't get an alert when initailly loading the page. I did on a
reload I got alert initial js file loaded. When I clicked on Change it
in Netscape 4, I got an alert. I didn't notice any changes. Twice,
half the text in Change it in Netscape 4 text turned red and the other
blue. Clicking on this text, crashed Netscape 4.77.


I gotta get me a MAC :(

Thanks Robert.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #6
Amir Hardon wrote:
Randy Webb wrote:

This page:
http://www.hikksworld.com/loadJSFiles/
Is one where I was testing the ability of browsers that can/can't
dynamically load a JS file with one of the three methods:
1)Changing the src property of a script tag.
2)Inserting a script src="" tag in a div via innerHTML
3)Using document.create Element to add a script element.

The fourth method on the page is writing a script tag to a layer, and to
the best of my knowledge it only works in NN4.xx (only tested on
Windows), but MAC testing in NN4.xx would be greatly appreciated as
well, just for my own knowledge.

What I don't have is access to any browsers running on Linux or a MAC
(strictly Windows access). Can I get it tested in browsers other than
whats listed on the page, and in different OS'es?

Any and all feedback is greatly appreciated.
Mozilla 1.4 under Linux, only CreateElement works.
Konqueror 3.1.4 under Linux, the first page is unusable(it looks terrible
and I can't click the buttons).


I changed it from <buttons> to links, so maybe it will work to test in
Konqueror now.
Galeon 1.3.8 under Linux, only CreateElement works.

I also tested it with Lynx, but it was unusable.


Many thanks.

I have changed a few things in the layout now, so maybe it can be
tested, and added some things to the page that explain what it
should/would do.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #7
Randy Webb wrote:
Richard Cornford wrote:

<snip>
... . With safari none of the methods worked.
With Mac IE 5 the innerHTML method worked but the
SRC setting method errored at the point of assigning
to the - src -property and the createElement method
errored at exactly the same point.


The script I have now is nothing more than the scripts we
used before, with each method invoked via a button, so its
the same script.


My test version is you original functions triggered with buttons so they
are going to be equivalent. The Mac results (especially IE 5's
unwillingness to work with either - src - setting or createElement, the
opposite to Windows IE) made me conclude that dynamically loading
scripts should not be considered viable. I can't think of any good way
testing which, if any, was supported in the browser in use. Except using
setTimeout to try to load some scripts and seeing if any of the
techniques worked, but that would be an ugly hack and there would still
be browsers that just could not do it.

Richard.
Jul 20 '05 #8
Richard Cornford wrote:
Randy Webb wrote:
Richard Cornford wrote:


<snip>
... . With safari none of the methods worked.
With Mac IE 5 the innerHTML method worked but the
SRC setting method errored at the point of assigning
to the - src -property and the createElement method
errored at exactly the same point.


The script I have now is nothing more than the scripts we
used before, with each method invoked via a button, so its
the same script.

My test version is you original functions triggered with buttons so they
are going to be equivalent. The Mac results (especially IE 5's
unwillingness to work with either - src - setting or createElement, the
opposite to Windows IE) made me conclude that dynamically loading
scripts should not be considered viable. I can't think of any good way
testing which, if any, was supported in the browser in use. Except using
setTimeout to try to load some scripts and seeing if any of the
techniques worked, but that would be an ugly hack and there would still
be browsers that just could not do it.


On the test page, its fairly trivial, as each method loads a different
..js file.
createElement loads createElement.j s --> alerts 'createElement worked'
innerHTML loads changeHTML.js --> alerts 'innerHTML worked'
changeSource loads changeSource.js --> alerts 'changeSource worked'

After making the list of the stats of what browsers do/don't support
what methods, I was thinking about how to test it to make sure that the
js file actually got loaded, without user input and came up with about
what you did. To try to load it, and then check a variables existence
thats in the .js file.

When I first started playing around with it, I had a personal page that
was in a frameset that I was trying to get rid of and came up with the
idea of trying to load .js files and changing div tags innerHTML
property. Now, its just something I tinker with every now and then to
see what can/cant be done with it. If pushed now to try to do it, I
would probably load a full page in an IFrame with a .src script element
and get it from there. And then in the end say "to heck with this" and
come up with some other approach.

Even then, its still something fun to tinker with :-)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 20 '05 #9
Randy Webb <hi************ @aol.com> wrote in message news:<x5******* *************@c omcast.com>...
Robert wrote:
In article <Ep************ ********@comcas t.com>,
Randy Webb <hi************ @aol.com> wrote:

This page:
http://www.hikksworld.com/loadJSFiles/


On MacOS 10.6.2:

iCab 2.9.7 No initial alert. None of four links give alerts.

IE 5.2 I get alert on Change InnerHTML. No alerts on the other
three.

Netscape 7.1 Create element works. The other three do not.

Netscape 4.77 running in classic. No initial alert on first load.
Get message on reload. Both Change it in Netscape 4 and Load It In
A Layer work first time, but not a second time. I do not think
Netscape 4.77 is reliable in this area. I got it to crash in prior
version of page.

Windows 95
IE 4.72 change source got error line 20. Change inner HTML got error
line 12. Create element got error line 16. load it in a layer did
nothing.

I gotta get me a MAC :(
Try ebay. Be sure to get on that runs MacOS 10.3. Great machines
once you get over the higher initial cost. Buy a machine that has
just been discontinued. Try on eMac. iBooks is a good value.


Linux. I believe that most Linux distributions you can load on
multiple machines. Most have dual boot capablities.

Robert
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3016
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web page dynamically. To do this, First I including a web page (MainPage.aspx) and I made form tag to Runat=Server. I included one table tag and also made this table Runat=Server side. Second I created three Web User Controls e.g....
1
2570
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web page dynamically. To do this, First I including a web page (MainPage.aspx) and I made form tag to Runat=Server. I included one table tag and also made this table Runat=Server side. Second I created three Web User Controls e.g. wucCustomerInfo.ascx,
1
3801
by: ozzy.osborn | last post by:
Hello All, I have been struggling with a cross browser solution to loading external javascript files on the fly. I have been successful using the following code in IE6: var newScr = document.createElement("SCRIPT"); newScr.src = "newScr.js"; newScr.type="text/javascript";
4
2772
by: max | last post by:
Hello, Based on various posts, I've come up with the following code to load data into a js array dynamically without a screen refresh. It works, but you have to push the button twice before it shows the new data that you have changed in the js file. It's almost like something is being cached. Can anyone help? Following is the code from the php and js file: test.php
6
6874
by: Dan Dorey | last post by:
I actually have two questions here, but I'll start by giving an outline of what I'm trying to do. I'm building an app with a simple plugin architecture (all in the same app domain). I have each plugin in a separate sub-dir inside a "Plugins" directory. Each plugin consists of at least two DLLs (a controller and a driver). However, most drivers also rely on other external DLLs. In one particular case this dependency is to a C++ DLL...
2
1880
by: 20050407 prerelease | last post by:
Hi! Is it possible in a fairly portable manner to load additional javascript code from a WWW URL? This would be useful for large-scale projects.
1
1834
by: Bob Rock | last post by:
Hello, I'm new to ASP.NET and I've been looking into the topic of dynamically loading (typically accomplished with a LoadControl followed by a MyControl.Controls.Add()) both user controls and asp.net web controls. I searched for articles on the internet and in the end I must say that I'm confused. I read about issues related to: a.. events not firing
2
5107
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application = Windows Forms class B = a singleton hosted within A. B is responsible for dynamically loading classes X, Y, and Z.
20
4288
by: Nickolai Leschov | last post by:
Hello all, I am programming an embedded controller that has a 'C' library for using its system functions (I/O, timers, all the specific devices). The supplied library has .LIB and .H files. How can I dynamically load a LIB file and access all its functions? Surely someone has solved similar task? My intention is to use a Forth system for programming the controller,
0
8468
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
8386
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
8901
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...
0
8814
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...
0
5683
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
4209
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
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
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
1792
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.