?
Solved

decode html query string in javascript using replace function

Posted on 2004-09-02
4
Medium Priority
?
623 Views
Last Modified: 2009-07-29
hey i need a regular expression to pass into the jscript replace function.

all i'm trying to do is replace the %20 from the query string that gets passed over with the space that was originally there.  

thanks
0
Comment
Question by:das165227
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
darksinclair earned 800 total points
ID: 11963731
Could you just use strQuery = strQuery.split("%20").join(" "); ?
0
 

Author Comment

by:das165227
ID: 11963861
yeah that works too.  

i'm curious as to why this won't work though if anyone wants to post for the hek of it and since its pretty simple.  

var regExpression= /%20/;
text= text.replace(regExpression," ");
0
 
LVL 5

Expert Comment

by:darksinclair
ID: 11965618
I'm not 100% sure on regular expressions.. but from what I know I think this is close to trim white spaces...

 var objRegExp = /^(\s*)$/;
0
 

Author Comment

by:das165227
ID: 11967342
i'm not wanting one to trim white spaces.  i was wanting one to look for the %20 in the jscript replace function.  i thought the code you gave me earlier worked but theres a problem with it somewhere.  i'm not sure where but its messing the html up somewhere that i'm passing over through the query string.  i'll post the question again
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question