Click to See Complete Forum and Search --> : How do I associate a javascript file(.js) with javascript contained in an image tag?


TVHostChris
May 19th, 2003, 02:10 AM
Hello,

I need to know how to load 3 different javascript files
(.js) on a page, and then I need to know how to, in a
"simple way", to associate those .js files with some
javascript I have in 3 different image tags on my page.

One of the exact image tags with the javascript and an
example message to be displayed when the user does a
mouseover is,

<img src="images/tip.gif" width="148" height="20" onmouseover="return escape(' The message that is displayed goes where this text your reading is. If you want quotation marks you have to do the following \'\'. Actually you need those backslashes if you want to type a word like... It\'s ')">

The Author who hasn't responded to any of my requests,
suggested on his page that, the <script> tag below

<script language="JavaScript" type="text/javascript" src="tip_tooltip.js"></script>

be placed just before the closing </body> tag.

I would like to Thank You Vey Much for any assistance you could provide.

Satishpp
May 19th, 2003, 01:38 PM
Your question is not making much sense to me , but I will try to answer...

I need to know how to load 3 different javascript files

This is how you 'load' javascript (js) files in your web page

<HEAD>
<script src="js1.js"></script>
<script src="js2.js"></script>
<script src="js3.js"></script>
</HEAD>

and then I need to know how to, in a "simple way", to associate those .js files with some javascript I have in 3 different image tags on my page.

are you trying to call a function defined within one of those js files on some image's mouseover etc event?

So, if you have a function named somefn() in your js file which you want to call on an images mouseover, first include the js file as shown above, then

<img src="abc.jpg" onmouseover="somefn()">

...basically you dont have to do anything special to call the function from the js file, as long as you have it included.

Incase this is not the answer you are looking for, please rephrase your question

Satish