Closed Thread Icon

Topic awaiting preservation: writing classes based on link urls (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=26504" title="Pages that link to Topic awaiting preservation: writing classes based on link urls (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: writing classes based on link urls <span class="small">(Page 1 of 1)</span>\

 
JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

posted posted 08-22-2005 10:08

Is it possible using javascript to search a page (forum listings) and apply a class to the TR that contains a td>a with a particular variable in the url of said link?

Did that even make any sense?

I made a picture of what I'm trying to say since my javascript vocabulary is non-exisitant

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 08-22-2005 10:35

Yep that's possible.
You could getElementsByTagName( 'A' ) on the handle of the table to get the collection of A tags in your table. Then with a simple loop on that collection check if your search string appears in the href attribute of each A tag. If the search string is found, pick the parentNode of the A until you reach the TR tag and bam!

Do you need a code sample ?

JKMabry
Maniac (V) Inmate

From: raht cheah
Insane since: Aug 2000

posted posted 08-22-2005 20:21

code sample, um, yes?

I *think* I understood most of that, got a little twisted at the mention of the "handle of the table"... you're talking about an ID for the table?

thanks poi

« BackwardsOnwards »

Show Forum Drop Down Menu