[Javascript] Problem changing link's href property...
Anthony E.
apwebdesign at yahoo.com
Thu Jul 12 18:38:11 CDT 2001
try
document.link.jumpTo.href = '/newpath/file.html';
--- Chris Nafziger <CNafziger at sauder.com> wrote:
> I'm having a problem with the function below. The
> first two lines do what
> they are supposed to do just fine. The third line
> does manage to change the
> URL of the link, however it only works if I use the
> ID of zero that you see.
> If I replace the the zero with the value assigned to
> the link's name
> property, 'JumpTo', similar to the first two
> function lines, the error
> 'document.links.JumpTo' is null or not an object
> comes up. Why can't I use
> the link's name property value for the reference
> like I did with the images?
>
>
> // Function that swaps two images and changes the
> link URL
> // when one of the swatch image's onMouseover event
> fires.
>
> function imageOn(i)
> {
> document.images["Unit"].src = UnitImages[i].src;
> document.images["UnitNumber"].src =
> UnitNumberImages[i].src;
> document.links[0].href = Page[i]
> }
>
> <a href="LinkToPage.asp" name="JumpTo"
> id="JumpTo">Link</a>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
More information about the Javascript
mailing list