1 var comment ={}; 2 comment. postid = 2892826; // each blog corresponds to a unique ID, which must be 3 comment. body = '000000'; // comment content, which must be 4 comments. parentcommentid = 0; // The default value is 0. when commenting on an existing comment, the Comment ID must be 5 $. ajax ({6 URL: '/MVC/postcomment/New. aspx ', 7 data: JSON. stringify (comment), 8 Type: "Post", 9 datatype: "JSON", 10 contenttype: "application/JSON; charset = utf8", 11 success: function (data) {12 if (data) {13 if (data. issuccess) {14 alert ("successful! ") 15} else {16 alert (data. Message); 17} 18 19} else {20 var errormsg =" Sorry! An error occurred while submitting the comment! Contact the Administrator (contact@cnblogs.com ). "; 21 alert (errormsg); 22} 23}, 24 error: function (xhr) {25 alert (" Sorry! An error occurred while submitting the comment! Error message: "+ xhr. responsetext); 26} 27 });