JavaScript function to the rescue! Jul08 '06
After all of my whining and griping (such a baby I am), I stumbled upon the JavaScript function encodeURI.
That’s it. It took care of all of my problems (for today).
Isn’t it funny how much mental anguish one goes through, when the answer is right in front of their faces?
Ah, the life of a developer.
(I need a drink.)
Categories: JavaScript ![]()
Add Feedback (view all)
Leave feedback
Ooh tasty... Even better. I will try that, thanks. I am calling it for each, yes, so that should be better. ... Read more.
This blog saved my life. I was implementing an AJAX submit for my site, which involves a WYSIWYG editor. Needless to say, all those quotes, ampersa ... Read more.
Yea it really is a lifesaver. Imagine all the extra coding if that function didn't exist. Yuck. Escaping invalid characters is not ... Read more.
I too will thank you for this. Until now I have been using encodeURI() but I suddenly found my AJAX cutting a variable off when it had an a ... Read more.
I'm new to sending things via POST in ajax. And I am building a WYSIWIG type application. ajax is perfect for this type of application, but boy d ... Read more.
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Similar Entries
- JavaScript badges should reside on the bottom of the HTML page (138 recent visits)
- JavaScript: billing/shipping address copy (171 recent visits)
- JavaScript string replace for post slug (1243 recent visits)
- Using JavaScript to obtain data from HTML and XML (238 recent visits)
- JavaScript set selected on load (8886 recent visits)
- JavaScript can access hidden HTML (465 recent visits)
Stats
32 unique visits since August 2008
Recent Referrers (click)
- javascript
- http://matthom.com/archive/200
- http://matthom.com/archive/200
- http://matthom.com/archive/200
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- http://matthom.com/archive/200
- http://matthom.com/archive/200
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- http://matthom.com/archive/200
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- http://gamedev.net/community/f
- javascript
- http://gamedev.net/community/f
Actually, I think you might want encodeURIComponent() instead of encodeURI(), assuming that you’re calling it for each parameter value that y ... Read more.