Skip to content

Instantly share code, notes, and snippets.

@stajnert
Created May 20, 2013 13:33
Show Gist options
  • Save stajnert/5612247 to your computer and use it in GitHub Desktop.
Save stajnert/5612247 to your computer and use it in GitHub Desktop.
how to send data with + in javascript
<script type="text/javascript">
$.ajax({
type: 'POST',
cache: false,
data: 'params=' + escape(JSON.stringify(structure)).replace(new RegExp("\\+", "g" ),"%2B"),
url: '/adm.php/sendregexp',
success: function(response) {
var result = jQuery.parseJSON(response);
if (result.code == 300) {
$.each(result.message, function(i, l) {
$('#name-' + l).css('border', '1px solid red');
});
} else {
alert(result.message);
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment