Gossamer Forum
Home : General : Internet Technologies :

How do I use mutiple .js's on same page?

Quote Reply
How do I use mutiple .js's on same page?
Hello,

I didn't describe or phrase or ask my question very well in
my last Post and for that I do Apologize.

I think I've figured out how to ask it now so... here we go.
I'm giving it my best shot.

POST CONTENTS
1.) Description of Code
2.) Prelude to Question
3.) Question


1. ) DESCRIPTION: (I'm giving you just the code on the page I'm concerned with)

First, I made a page and it works perfectly well with only one .js file loading and associated with all designated images.

The page lay out looks like the following

<HTML>
<HEAD>
<TITLE>Page Name</TITLE>

<HEAD>
<BODY>

<img src="images/tip1_image.gif" width="148" height="20" onmouseover="return escape('TEXT MESSAGE DISPLAYED FROM HERE WHEN MOUSEOVER OCCURS')">

<img src="images/tip2_image.gif" width="118" height="36" onmouseover="return escape('TEXT MESSAGE DISPLAYED FROM HERE WHEN MOUSEOVER OCCURS')">

<img src="images/tip3_image.gif" width="103" height="168" onmouseover="return escape('TEXT MESSAGE DISPLAYED FROM HERE WHEN MOUSEOVER OCCURS')">

<!----- Just above closing Body tag---->
<script language="JavaScript" type="text/javascript" src="tip_tooltip.js"></script>
</BODY>
</HTML>

All those images above use that one tip_tooltips.js file.
All the mouseover displays "are the same" width and color.

2.) PRELUDE:

I know how to change the width and color in that .js file so...
I'd like to copy and paste that tip_tooltips.js file a couple of times
and rename those newly copied and pasted .js files to correspond with
the images so I know what .js file belongs to what image and I can then
change width and colors of the mouseover displays in each .js file

So... In other words I want each image to use it's own .js file like,

tip1_image.gif associated with tip1_tooltips.js and
tip2_image.gif associated with tip2_tooltips.js and
tip3_image.gif associated with tip3_tooltips.js all on the same page.

3.) QUESTION:

How would each single .js file be associated with it's corresponding image?

I'm not a programmer so please be specific with a solid unambiguous example please.

That's pretty much it so "Thanks" in advance and I'll be looking forward to your reply.
"Helping others is life's best reward !"

With Regards,
Chris Perron
Computer Commandos TV Show
Website:
Computer Commandos TV Show
E-Mail: host@computercommandos.com
Quote Reply
Re: [TVHostChris] How do I use mutiple .js's on same page? In reply to
Mm the best thing to do would have been to _reply_ to your original post with this updated question rather than starting a new thread.