[quoted text, click to view] "Nathan Sokalski" <njsokalski@hotmail.com> wrote in message
news:Oavw8wVTFHA.3176@TK2MSFTNGP09.phx.gbl...
:I have a rollover script that I plan to use for many of my pages. When I
: preload the images, the directories must be relevant to the location of
the
: HTML file that uses the script, which will not always be the same. Because
: of this, I figured the only way to place the script in an external file
and
: still have it work was to use full path names including everything after
the
: domain. For example, if my image was located in
:
http://www.mydomain.com/images/image1.gif, I would like to store the
: directory as something like /images/image1.gif so that I have the entire
: path entered but do not have to modify it when my domain changes. However,
: Javascript does not seem to like the format I showed above. What can I do
to
: achieve this? The lines of code where this will be used currently look
like
: the following:
:
: navrollovers[0]=new Image();
: navrollovers[0].src="images/button_home_white.gif";
:
: As you can see, the second line will not work for HTML files in
directories
: other than the root. What should the code look like? Thanks.
just use:
navrollers[0].src="/images/button_home_white.gif";
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/ WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp MSDN Library -
http://msdn.microsoft.com/library/default.asp