Created
May 20, 2013 13:33
-
-
Save stajnert/5612247 to your computer and use it in GitHub Desktop.
how to send data with + in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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