我在aspnet2.0中继承模板页的一个页面中用jquery写ajax,怎么就是不出数据呢
jquery代码 $(document).ready(function() {
$("#Button4").click(function(){
$.ajax({
type: "POST",
url: "TaskInfoDefault.aspx/ReturnHtml",
data: "{}",
dataType: 'json',
contentType: "application/json",
success: function (msg) {
alert(msg.d);
$("#tdhtml").html(msg.d);
}
}); });
});后台的方法:
[WebMethod]
public static string ReturnHtml()
{
return " {\"Json\":\"aaaa\"}";
}求解为什么前台得不到数据呢?
jquery代码 $(document).ready(function() {
$("#Button4").click(function(){
$.ajax({
type: "POST",
url: "TaskInfoDefault.aspx/ReturnHtml",
data: "{}",
dataType: 'json',
contentType: "application/json",
success: function (msg) {
alert(msg.d);
$("#tdhtml").html(msg.d);
}
}); });
});后台的方法:
[WebMethod]
public static string ReturnHtml()
{
return " {\"Json\":\"aaaa\"}";
}求解为什么前台得不到数据呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货