, - JSON, jQuery, , . :
$.ajax({
url: "http://tonofweb.com/MyService.asmx/Sum",
contentType: "application/json; charset=utf-8",
data: { x: JSON.stringify("1"), y: JSON.stringify("2") },
dataType: "jsonp",
success: function (json) {
alert(json.d);
},
error: function () {
alert("Hit error fn!");
}
});
. contentType: "application/json; charset=utf-8", .
, http://tonofweb.com ( 403 ), jQuery, jQuerify bookmarklet, ( contentType), , ( contentType),
Chrome:
contentType:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">"Now i am getting jsop string""2nd param"</string>
contentType:
{"d":"12"}
, , , JSON . , , , contentType.
. JSON:
ASMX JSON -
HTTP- - /json. ScriptService , JSON .
, , . dataType: "jsonp" dataType: "json", . , - , jQuery JSONP.
, , JSONP :
jQuery17106476630216930062_1326752446188({"d":"12"})
, , JSONP -, : Response.Filter, Response.Write.