...

View Full Version : Javascript fundamental question



mbl
11-06-2004, 01:56 AM
Dear friends,

Would like to know if there is a in javascript use the capability of having the equivalent of 'cascading functions' so as to have functions be shared from a common place, similar to style sheets.

If so, a link about it would be appreciated.

Thanks.

-mbl-

kansel
11-06-2004, 02:21 AM
To have functions shared from a central location, put them into an external .js file. Otherwise you'll need to clarify what you mean.

mbl
11-06-2004, 02:52 AM
To have functions shared from a central location, put them into an external .js file. Otherwise you'll need to clarify what you mean.

Dear kansel,

Am fairly new to this. So an external .js file maybe what's in mind, will check it out, or if you have a link.

What's meant, though is, say there's 3 or so javascript functions that are used in most of the html pages. Well the thing is how to have those 3 functions in one single file and call them from each html page that needs them.

Thanks.

-mbl-

mbl
11-06-2004, 02:57 AM
Dear Kansel,

Found the info already. Yes, it'd be external js files. Just needed the right terminology for the search engine.

Thanks.

-mbl-

kansel
11-06-2004, 05:05 PM
Yes, just put the functions into a plain text file and name it with a .js extension. Be sure to NOT include the <script></script> tags in that file.

In your HTML files, call the .js file like so <script type="text/javascript" src="myfunctions.js"></script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum