View Single Post
Old 09-17-2012, 10:02 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,556
Thanks: 62
Thanked 4,056 Times in 4,025 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Quote:
3. Dynamically alter a href tags on the fly based on the parameters gathered from the URL.
Don't do that. Or at least not as you have written it.

Instead, have the onclick for the <a> invoke a JavaScript function that picks up the href, alters/appends to include the querystring pairs, and then just does location.href = ...the altered url...

That way you have one function that can handle multiple <a> tags, doing the same thing for each.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
algross (09-18-2012)