home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1896
Discussions: 188,398, Posts: 2,243,591, Members: 232,627
Old December 29th, 2004, 09:12 PM   Digg it!   #1 (permalink)
Ultimate Member
 
Join Date: Jan 2003
Location: MA / NH
Posts: 1,497
Send a message via AIM to Blazer06
Need Some Javascript Help!

I want to have a small javascript program append every link on the page with varibles I'm passing to it through the URL.

Example:
URL = "http://www.nameofsite.com/index.php?page=2&d_y=2004&d_m=12&d_d=29"

I want the javascript app to add this to the end of every link on the page:
&d_y=2004&d_m=12&d_d=29

Any help?


Blaze

Blazer06 is offline   Reply With Quote
Old January 2nd, 2005, 02:56 AM     #2 (permalink)
Ultimate Member
 
Join Date: Dec 2004
Posts: 1,558
easiest way (i think):

Code:
<A HREF="http://www.nameofsite.com/index.php?page=2">This is your link</A>

<SCRIPT language="javascript" type="text/javascript">
var links_array=document.links;
for(i=0; i<links_array.length; i++){
	document.links[i].href=document.links[i].href+"&d_y=2004&d_m=12&d_d=29";
}
</SCRIPT>
Should be W3C compliant as far as I know.

large_nostril is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
No javascript popups in xp pro/ie6 ??? ^hyd^ Applications and Operating Systems 17 September 14th, 2004 11:45 AM
Internet Explorer 6 Problems vesther Applications and Operating Systems 6 June 22nd, 2004 08:22 PM
a thanks to everyone sao95 Graphic Design and Digital Photography 16 May 13th, 2004 10:43 AM
Java Scrpit Juztyn Graphic Design and Digital Photography 2 December 4th, 2002 02:42 PM
WinXP Pro and Javascript question bill1971 Applications and Operating Systems 6 August 31st, 2002 04:06 AM

Most Active Discussions
Is It Just Me? (2904)
Unarmed man on his stomach shot by .. (6)
3-days in and no threads about Gaza (161)
New Build ( Finally ) (6)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
Folderchat Weekday thread (444)
Upgrading RAM (6)
Recent Discussions
Left 4 Dead Small Freezes (3)
RCA 52Inch HDTV wont turn on (4)
wishin i could edit my aol prof.. (0)
For cheap price and good qualit.. (0)
Sporadic internet connectivity (2)
Assassins Creed PC Problems (40)
I think my PSU is dieing (1)
building a gaming computer, inp.. (0)
Iming and surfing slowed down (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 03:18 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28