/    Sign up×
Community /Pin to ProfileBookmark

parse string in URL

I’m horrible at javascript, I need help.

I’m trying to parse a string from a URL and pass it as a parameter to another function. If that parameter meets certain conditions, I want hidden fields in my form to “unhide”.

Here’s why I need this:
I am giving 3 usersr a specified url i.e. ([url]http://DOMAINNAME.com?usr=uk[/url] or [url]http://DOMAINNAME.com?usr=france[/url]) and based on that url, we’ll parse the name and pass it as a parameter to a function. (i think i expressed that right??) Then we will display the proper shipping address depending on the parameter passed. My only problem now is, i’m horrible at writing regular expressions and programming in general. Do you or anyone else out there know of any good url parseing functions? I’ve been doing mostly project management throughout my career and never really got a chance to become fluent in javascript or programming for that matter. I’ll be doing my research in the mean time. Thanks again for all your help, much appreciated.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@ZeroKilledNov 16.2007 — on the web there're js library that can query for value passed by uri. however, i don't know any because i have never needed one due that i develop my own version. on the following link look for post number five and eight where i post and explain how to query those value from uri. you'll see that you don't need regular expression at all to retrive those value. if need help, come back again.

http://www.webdeveloper.com/forum/showthread.php?t=163635
Copy linkTweet thisAlerts:
@chrismondauthorNov 16.2007 — Thanks for your input Zero, I'll check it out! ?
Copy linkTweet thisAlerts:
@yearbassNov 17.2007 — or you can check out prototype.js library

http://www.prototypejs.org/api/string/toQueryParams
Copy linkTweet thisAlerts:
@Jeff_MottNov 17.2007 — And there's another packaged library available here at WebDeveloper: <http://www.webdeveloper.com/forum/showthread.php?p=808567>.

So, chrismond, it seems you have several options to choose from. ?
×

Success!

Help @chrismond spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...