Page 1 of 1

Linking JavaScript ???????

Posted: Fri Apr 16, 2004 6:16 pm
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.

Posted: Fri Apr 16, 2004 6:19 pm
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..

Posted: Fri Apr 16, 2004 11:08 pm
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...