Linking JavaScript ???????

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
saviiour
Forum Newbie
Posts: 7
Joined: Fri Feb 27, 2004 1:11 pm

Linking JavaScript ???????

Post by saviiour »

Me again.........hehehe

Just a small question......

Iam using a javascript code on my webpage, and all of a sudden i realized my webpage code would look even cleaner if i linked the javascript externaly using a ".js" file.

I linked it all right. The prob is. I have commands on my images, that call for certain functions withing my javascript code.

Since i have it in a file. How can i go abouts calling out that function from the file.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

usually just calling the function outright... the function may not be defined if it didn't load properly or there are unresolved errors in your code though..
User avatar
llanitedave
Forum Commoner
Posts: 78
Joined: Thu Jan 15, 2004 11:24 am
Location: Las Vegas, NV.

Post by llanitedave »

Are all the functions in the same file? You need a <script> tag for each .js file, and if there are any functions that are not in an external file, you need a separate <script> tag for them as well.

Otherwise, as feyd said, all the functions should work just as they did before -- just call their names, and they'll be there...
Post Reply