Board index   FAQ   Search  
Register  Login
Board index Web Development Forums Programming Forum

Getting an external javascript file to work

Programming forum to discuss all other languages, coding or scripting.

Getting an external javascript file to work

Postby Naina » Tue Dec 28, 2010 6:43 am

Hi, I am creating a page that pretty much uses Javascript on every page: rollovers, a large tent, a clock, etc., and so decided to put all the code in an external JavaScript file on the advice of a friend.

I can not all javascript to work now! I've searched online tutorials on external javascript pages, and I can not find anything to help me this problem.

In principle, the rollover links work, and I see why - the javascript is "hot"from the js file but I have no idea how to 'call'of the clock or tent script .. They both used to be in the cells, and now I have taken all the code from the cells and put them in the external file, no further code in the cells is needed to activate his script.

I'm afraid I have nothing about coding javascript to know myself, and all the code I used is based on free resource sites.

Can someone please help?
Naina
 
Posts: 1057
Joined: Tue Dec 21, 2010 12:26 pm

Re: Getting an external javascript file to work

Postby Emma » Tue Dec 28, 2010 6:43 am

Put your desired functionality inside a function.

Code:

Code: Select all
function myFunctionality()
{

    // Insert your code here.....

}


Then you should be able to invoke the functionality the same as with the rollovers - by calling the functions.
Emma
 
Posts: 398
Joined: Tue Dec 21, 2010 12:44 pm


Return to Programming Forum

Who is online

Users browsing this forum: No registered users and 4 guests

cron