Side navigation
#8798 closed bug (duplicate)
Opened April 07, 2011 10:46AM UTC
Closed April 07, 2011 11:01AM UTC
Last modified April 07, 2011 12:11PM UTC
jQuery appends some weird string on the data sending to server
Reported by: | neodeep2001@hotmail.com | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | data | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
StackOverflow discussion:
http://stackoverflow.com/questions/5578754/jquery-append-some-weird-string-into-the-data-submitted
Code to reproduce the bug (Put the following code in the html page and read the data submitted in Fiddler. jQuery 1.4.2 works fine, the problem happens in 1.5.1 and 1.5.2).
<html>
<head>
<script src="https://github.com/douglascrockford/JSON-js/raw/master/json2.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>
var data = { "Name": "test??", "testDesc": "testdesc??"};
$.ajax({
url: "submit.aspx/SubmitData",
data: JSON.stringify(data),
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false
}).success(function (msg) {});
</script>
</head>
<body></body>
</html>
With the above code, the data sending to the server is
{ "Name": "testjQuery15103933552800185728_1302170988810", "testDesc": "testdesc??"}
The jsFiddle link:
http://jsfiddle.net/uTq4n/