HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 25th, 2000, 01:20 PM
gonorato gonorato is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Red Bank, NJ 07701
Posts: 7 gonorato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello,

I am desperatly trying to retrieve the quesrystring from a javascript src tag.

I.E <SCRIPT LANGUAGE = "JAVASCRIPT" SRC = "http://mydomain/script.js?h=1&b=2"></SCRIPT>

Van anyone give me a clue on how to retrieve the values for h and b in this instance?

Reply With Quote
  #2  
Old September 5th, 2000, 09:36 PM
rkmarcks rkmarcks is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 81 rkmarcks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via AIM to rkmarcks
link.search will return the search portion of a URL. Suppose the link http://www.mine.com?x=1&y=4#bookmark is the fifth link on your page (in the order it appears in the code). Then:

document.links[4].search should return ?x=1&y=4

At this point, you can use your string functions to take it apart and determine your values.

On simpler data values passes through a URL, I tend to send them as a value only. This works especially well if your variables have the values of 0 thru 9 [ie:single digit or at least a set number of digits]. This way, if I pass the values 3 & 7, I can retrieve the string ?37 which is much easier to take apart and pass where ever it is your are sending them.

Russ

Reply With Quote
  #3  
Old September 5th, 2000, 10:29 PM
gonorato gonorato is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Red Bank, NJ 07701
Posts: 7 gonorato User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi and thanks for the reply.

Suppose I don't know where this link will appear on the page? Any tips on how to handle that?

Thanks!

Gerard

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > JS SRC tag and querystring


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not 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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT