我在中使用以下代码,但在我的网络方法中,我返回的是纯 HTML。contentType 就在这里吗?
function PopulateTimetable(pGroupId) {
$.ajax({
type: "POST",
cache: false,
url: "StudentTimetable.aspx/PopulateTimetable",
data: "{ 'pGroupId': '"+51+"'}",
contentType: "application/json; charset=utf-8",
dataType: "html",
timeout: 10000,
success: function(data) {
$("#divTimetable").removeClass("Progress");
$("#divTimetable").html("").append(data);
},
error: function() {
$("#divTimetable").removeClass("Progress");
alert("An unexpected error has occurred during processing.");
}
});
}