Connecting Tech Pros Worldwide Forums | Help | Site Map

Call external functions

kirkox
Guest
 
Posts: n/a
#1: Jan 24 '07
Hi guys, this is my first post. I am a newbie, of course.

The question is really simple:
how can I call functions from an external file in a new js file and
work with its method?

Thank in advance.
Bye


Benjamin
Guest
 
Posts: n/a
#2: Jan 24 '07

re: Call external functions




On Jan 23, 7:40 pm, "kirkox" <mircovel...@gmail.comwrote:
Quote:
Hi guys, this is my first post. I am a newbie, of course.
>
The question is really simple:
how can I call functions from an external file in a new js file and
work with its method?
First make sure you have a tag like this:
<script type="application/x-javascript"
src="path/to/my/js.js"></script>
Then you can just call the function like it was in the same file!
Quote:
>
Thank in advance.
Bye
cwdjrxyz
Guest
 
Posts: n/a
#3: Jan 24 '07

re: Call external functions




On Jan 23, 8:42 pm, "Benjamin" <musiccomposit...@gmail.comwrote:
Quote:
On Jan 23, 7:40 pm, "kirkox" <mircovel...@gmail.comwrote:Hi guys, this is my first post. I am a newbie, of course.
>
Quote:
The question is really simple:
how can I call functions from an external file in a new js file and
work with its method?First make sure you have a tag like this:
<script type="application/x-javascript"
src="path/to/my/js.js"></script>
The above is correct. However I caution you not to also add the opening
and closing script tags to your external script file, or the script
will not work. This is a very frequent error made by those using
external script files for the first time.

Closed Thread