[thelist] Jscript vs. N4.7

Joe Crawford joe at artlung.com
Tue Sep 4 09:25:28 CDT 2001


on 9/4/2001 6:14 AM, George Palframan at george at themidwestgroup.com wrote:

> Thanks for the advice Richard,
> I wasn't aware of that <div> thing.
> I have found what was upsetting 4.7. It doesn't support swopping properties
> of the <a> tag:
> 
> eg.
> 
> atag.href = swopURL[image]
> atag.target = swopTarget[image]
> 
> where atag is the name of the <a> tag.


This is why for doing that I've always used it like this:

document.links[x].href

where x is the number of the link on the page (starting with 0, of course,
so the 5th link on the page (as counted in the source of the page) would be:

document.links[4].href

And you can set it to whatever you want it to.

document.links[4].href='http://evolt.org/'

The issue is that when you give a /name/ to an /href/ I think it wonders
which you want - an anchor, or an anchor target.

I have a silly sample of changing every link on a page here:

http://www.artlung.com/lab/scripting/change_all_links/

HTH,
    Joe

--  
...........  Joe Crawford : thinking and design about the web
.... enigmatic narcissism and miscellany : http://artlung.com
.... community instigator : http://WebSanDiego.org
.... San Diego, California, USA .....................AAAFNRAA





More information about the thelist mailing list