Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reloading a script

Status
Not open for further replies.

Rubie

Technical User
Nov 25, 2002
4
BE
Hello. This is the script that links to a random music chooser.

In the HEAD of the document:
<script language=&quot;JavaScript&quot; src=&quot;muziek.js&quot; id=&quot;musi&quot;></script>[\b]

If I want to change the music, the script has to be reloaded. How can you do that? ( document.all.musi.reload() doesn't work | document.all.musi.src=&quot;muziek.js&quot; doesn't work either)[\i]

Please help me with this matter.
Thanks in advance
Ruben
 
What does the code in muziek.js do? All your <script> tag is doing is including the .js file into your page. If, as you say, the <script> tag triggers the random music chooser then I assume the js code is not in a function.

You could incorporate the js code into a function in muziek.js. Then use the <script> tag as normal to include the js file.

On the OnLoad event on your page (in the <body> tag) you could then call your new function.

Does this make any sense?

Greg.
 
I'll try it right away

Stupid of me that I didn't think about it!

Thank you very much.
Ruben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top