jQuery jQuery, # 8417, , , , ; , .
, : :
jQuery(function($) {
$('#theButton').click(function go() {
var data = { "Name": "test??", "testDesc": "description"};
$.ajax({
url: "/icece5",
data: JSON.stringify(data),
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false
});
});
});
POST jsbin.com, , , , . Chrome dev, , JSON-P, .
, , jQuery, JSON ( ):
jQuery(function($) {
$('#theButton').click(function go() {
var data = { "Name": "test??", "testDesc": "description"};
$.ajax({
url: "/icece5",
data: JSON.stringify(data),
type: "POST",
contentType: "application/json; charset=utf-8",
cache: false
});
});
});
, , , . :
var data = { "Name": "test??", "testDesc": "testdesc??"};
$.ajax({
url: "submit.aspx/SubmitData",
data: JSON.stringify(data),
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "text",
cache: false
}).success(function (data) {
data = jQuery.parseJSON(data);
});
jsFiddle.net jQuery, - . , ; , , ...
:
, , POST , JSON, (jQuery151023383707909744822_1301931324827 ..) jQuery "expando" ( , jQuery ) _ . jQuery JSON-P, :
1 326-1 329 jQuery-1.5.1.js:
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
( 7,029-7,035):
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
return jQuery.expando + "_" + ( jsc++ );
}
});
, , , , , , , .
JSON-P ? URL- , JSON-P . , .
ajaxSettings .. , , ( , ? ) 7,033 ( ), , , .