[thelist] javascript:// :is it necessary?

Brian King BKing at Impact-Technologies.com
Thu Jun 28 11:22:44 CDT 2001


Thank you!  I do understand and will use the cache tip.
I am an ASP/VBScript coder by nature, but am augmenting my code with JS now.
Trying to get the best of both worlds.

Brian W. King

 -----Original Message-----
From: 	thelist-admin at lists.evolt.org [mailto:thelist-admin at lists.evolt.org]
On Behalf Of The Optimizer
Sent:	Thursday, June 28, 2001 12:11 PM
To:	thelist at lists.evolt.org
Subject:	RE: [thelist] javascript://  :is it necessary?

> What do you mean by,
> It works (and it is still javascript)

What I meant was that it will change the image to another image without
generating any javascript errors.

> I don't have any JS functions or class or jars on the pages at
> all.  I seem

You have no javascript functions, but images[imagename].src is a javascript
reference, and "images[imagename].src = 'Button1.jpg'" is a javascript
statement. "images" is a javascript collection of all the javascript image
objects on the page. "imagename" references the javascript image object that
you wish to change the src property for. If you then specify a path to an
image you are then submitting a request to the server for that image. This
will then take a finite amount of time to download, depending on the image
size and connections speed. If you previously declared:

imageTwo = new Image(); imageTwo.src = "Button1.jpg";

And then used:

images[imagename].src = imageTwo.src

This would make sure that the image had been cached (when you declared the
second image object). However, it's still more efficient to come up with a
generic mouseover function.

> to not be understanding something here.  images[imagename].src is refering
> to the object on the page.  Is that JS?  Have I unwittingly been
> writing JS
> into my HTML mouseovers?

Yes and yes ;)

Let me know if you need any further clarification, and HTH.

Regards

Chris Marsh


---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list