#2239 closed bug (worksforme)
plus sign (+) in data: element of ajax not sent to server
Reported by: | dasacc22 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.2.3 |
Component: | ajax | Version: | 1.2.2 |
Keywords: | + plus | Cc: | |
Blocked by: | Blocking: |
Description
I have tried escape()'ing the plus sign and i have tried sending it just as is, but the server does not get it, below i do both by appending my escaped form data to "my+content", again, server does not receive any plus signs.
<script> function submitform() { article = $("#article").val(); header = escape($("#header").val()); content = escape($("#content").val()); alert(content); $.ajax({ type: "POST", url: "article_save.php", data: "article="+article+"&header="+header+"&content=my+content"+content, success: function(html) { $("#debug").html(html); } }); } </script>
Change History (2)
comment:1 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 Changed 8 years ago by
$( "#cackulatr input" ).on('change',function() {
var z = $("#nambr1").val();
var h = $("#nambr2").val(); var w = $("#nambr3").val(); var k = z + h ; alert(k)
Note: See
TracTickets for help on using
tickets.
The problem is for an encoded URI the plus sign means spacebar. escape() has been deprecated in javascript. It should work using encodeURIComponent() instead. Or you can let jQuery do it for you by passing in an object with your data like
That should also work (assuming I didn't make any typos or mental errors).
Try those out and if you still find there is a bug you can reopen the ticket. Hope that helps.