0
我正在使用follwoing代碼,但在我的webmethod我返回純HTML。 contentType在這裏嗎?如何使用jQuery ajax調用原始HTML到ASP.net [Webmethod]
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.");
}
});
}