Using external js fil

K

KS

I have a folder where i got all my external javascript.js files saved.
Using the external.js files in my .jsp files works fin by:

<script language="JavaScript" src="/PlexSysWeb/javascript/disableObjekt.js">

</script><script language="JavaScript"
src="/PlexSysWeb/javascript/respons.js"></script>



I want to use/call a method in external disableObjekt.js inside a metode in
respons.js.

How do I do this. I could copy and paste the code, but im going to this a
lot, so if i change the code i have copy and paste

it would be alot of work.



Thanx in advance
 
M

Martin Honnen

KS said:
I have a folder where i got all my external javascript.js files saved.
Using the external.js files in my .jsp files works fin by:

<script language="JavaScript" src="/PlexSysWeb/javascript/disableObjekt.js">

</script><script language="JavaScript"
src="/PlexSysWeb/javascript/respons.js"></script>



I want to use/call a method in external disableObjekt.js inside a metode in
respons.js.

How do I do this. I could copy and paste the code, but im going to this a
lot, so if i change the code i have copy and paste

it would be alot of work.

Simply call the function, any script loaded after disableObjekt.js can
do that.
 
G

Greg

Martin Honnen said:
Simply call the function, any script loaded after disableObjekt.js can
do that.


I don't claim to understand the lifetime and visiblity of functions in
JS, but in my tests, what seems to matter is when a function is
called. For one function to call another, both must be loaded, but the
order does not seem to matter.

Is this wrong?

This surprised me. Am I mistaken?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,091
Messages
2,570,604
Members
47,223
Latest member
smithjens316

Latest Threads

Top