help with javascript

T

themasterrocker

Guest
Hi,

How can i boot javascript when my page loads i can't remember the code. its something like
<body_onload) theres something after the onload which i've forgotten. can you help please :)
 

medphoenix

New Member
Messages
354
Reaction score
0
Points
0
HTML:
<body onLoad="goforit()">

May be the above code will help you, but It depend on your Javascript content.
For Body onload function, lot of arguments available.
 
Last edited:
T

themasterrocker

Guest
it doesn't work. im tryin to boot this file on my directory. songswitch.js
How do i get it to boot when it loads?
 
T

themasterrocker

Guest
place what in the body section?
I've got
HTML:
<body onLoad="songswitch()">
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Do you want it to run the file 'songswitch.js' when the page loads? If you do, then try placing this somewhere between the '<BODY>' and '</BODY>' HTML tags.
<SCRIPT src="path/to/songswitch.js" type="text/javascript" language="javascript"></SCRIPT>

This should do what you want. Try it, and post back.
 
Last edited:
T

themasterrocker

Guest
nope, not done anything. all i can remember from what i got given by Wiowky was :: <body_onload <something here> but i can't remember what it is and Wiowky isn't on msn or answering his messages.
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
The <BODY onload="..."> is for running a function, not for including a file.

Check that code I gave you in my previous post, I had forgotten a ", which may have stopped it from working.
 
T

themasterrocker

Guest
yeah it's meant to run the javascript. so was i correct in the first instance? because if i am then its still not working cuz my image won't update. its really confusing me now =S
 
Last edited by a moderator:

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Can we see the source code of songswitch.js please. It may help.

Another suggestion. Try combining two methods mentioned above.
Put this in the <HEAD> ... </HEAD> section:
<SCRIPT src="path/to/songswitch.js" type="text/javascript" language="javascript"></SCRIPT>

And then use this
<BODY onload="the name of the function()>
Replace "the name of the function" with the name of the function that switches the image or whatever.
 
T

themasterrocker

Guest
That just took the image off the page which is what its not meant to do.
It needs to use the image to write the data into it.
And what do u mean can u see the source? can u look at the file? it's attached on here
 

Attachments

  • songswitch.rar
    657 bytes · Views: 2
Last edited by a moderator:
Top