473,403 Members | 2,354 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,403 software developers and data experts.

firefox scripts array

Hey if I have a script id is script1 and the src is test1.js in a html
page in firefox, how do I change that dynamically?

because script1.src = "test2.js"; ain't working.
Jul 23 '05 #1
2 1134
DU
Bryan wrote:
Hey if I have a script id
script elements do not take id attribute
http://www.w3.org/TR/html401/interac...ml#edef-SCRIPT

is script1 and the src is test1.js in a html page in firefox, how do I change that dynamically?

http://www.w3.org/TR/2000/REC-DOM-Le...tml#ID-A6C9094

var collScriptElements = document.getElementsByTagName("script");
collScriptElements[intIndex].src = "path\/test2.js";
because script1.src = "test2.js"; ain't working.


Not tested. Hey an url would have been useful.

DU
Jul 23 '05 #2
DU wrote:
Bryan wrote:
Hey if I have a script id


script elements do not take id attribute
http://www.w3.org/TR/html401/interac...ml#edef-SCRIPT


They do in Valid XHTML 1.0

<http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-strict.dtd_script>
<http://www.w3.org/TR/xhtml1/dtds.html#dtdentry_xhtml1-transitional.dtd_script>

so you can use (mostly) standards compliant

var s = document.getElementById("script_id");
if (s)
{
s.src = "...";
}

there. Whether using XHTML on the Web these days is a wise decision is
another matter, though: <http://www.hut.fi/u/hsivonen/xhtml-the-point>
PointedEars
Jul 23 '05 #3

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

Similar topics

4
by: ekimnosnews | last post by:
I'm programming a JS tile map editor for my friend's game. The map editor has different "sections" that contain different tiles. The way that it works is when you select a section it calls a JS...
5
by: hibernate | last post by:
I'm somewhat new to javascript/DHTML, and this problem has been plaguing me. I have made an 'array' of <div> tags within my html document like so: <div id="menu"> menu1 </div> <div id="menu">...
14
by: franz | last post by:
hallo everyone, i have a popup window 500x400px centered in the middle of the screen and inside it there's a mini-photogallery. what i want is to click on a thumbnail and open in the same window a...
4
by: Laurent Compere | last post by:
Hi all, I try to make a logo fade in. I wrote the code below that is simple and supposed to be compatible with IE6,Firefox and Netscape. It works pretty well under IE6 but under Firefox and...
4
by: fcurvat | last post by:
Hello, I've got a little problem with <script></script> under firefox 1.0.7 If the script is not placed in the body tag, it isn't automaticaly executed, but it is under Internet Explorer. ...
45
by: Pat | last post by:
its seems asp.net validation doesn't fire when using FireFox? Tested a page and it doesn't fire. It seems the javascript doesn't fire Any ideas?
4
by: the other john | last post by:
I came across a third party script I want to learn how to configure as well as learn more dhtml in the doing. I'm not much of a JS guy yet but I'm working on it. This script works fine in IE6...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
1
by: rjdougan | last post by:
I am not a developer but need some help with scripts for a client. I have a script to handle form validation and one that handle mouseover on menu. The form validation script works fine by it...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.