/    Sign up×
Community /Pin to ProfileBookmark

how to escape() a GET URL

I know questions about the escape() function have been discussed before but I am confused about how specifically to escape() the URL produced when a form is submitted.

I have the method down for unescaping that URL on the action page for the form but cannot seem to come up with a function to escape the URL properly in the first place. I have seen alternatives that build a location URL that escape all of the form fields but does not allow you to use your back button and correct the form.

It is mostly spaces that I want to convert to %20. Any help with just how to escape() the complete GET URL would be greatly appreciated.

Larry

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliNov 11.2003 — browser should automatically replace spaces with "%20". in my opinion you will only be worried about un-escaping it.
Copy linkTweet thisAlerts:
@MountaineerauthorNov 11.2003 — Unfortunately the browser replaces the space with a + sign rather than %20, unescaping does not replace the plus sign with a space. Thanks for the reply.
Copy linkTweet thisAlerts:
@Jeff_MottNov 11.2003 — unescaping does not replace the plus sign with a space[/quote]So you're trying to decode the query string then? If so then see [thread]162208[/thread].
×

Success!

Help @Mountaineer 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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