AJAX Tips: The great escape
Posted on Wednesday, 13 February 2008 11:05When developing applications with AJAX functionality, it is common to pull a value from a text area and pass in into a url for processing.
When doing this, always be sure to add the escape() function around your variables, to ensure they are URL Encoded, otherwise you'll loose parts of your text and your code will fall apart.
If you've escaped a variable, for passing between functions rather than a url, you can remove the formatting with the unescape() function.