function Loadtodo(s) {
$.ajax({
type: "POST",
async: true,
url: "Home.aspx/LoadTodo",
data: "{InvitaionID:" + s + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
count = response.d.length;
if(count!=0)
count = response.d[0].temp;
for (var i = 0; i < response.d.length; i++) {
if (response.d[i].Ischecked == 'false') {
$('.todo-card').prepend('<div class="todo-task"> ' +
'<input type="checkbox" id=' + response.d[i].checkboxid + ' /> ' +
'<label for=' + response.d[i].checkboxid + '>' + response.d[i].todoitem + ' <span class="todo-remove mdi-action-delete"></span> ' +
'</label> </div> ');
}
else {
$('.todo-card').prepend('<div class="todo-task"> ' +
'<input type="checkbox" id=' + response.d[i].checkboxid + ' checked="yes" /> ' +
'<label for=' + response.d[i].checkboxid + '>' + response.d[i].todoitem + ' <span class="todo-remove mdi-action-delete"></span> ' +
'</label> </div> ');
}
}
},
failure: function (response) {
//alert(response.d);
},
error: function (response) {
}
});
}
这是我的ajax代码。我调用jquery文件加载。我在IIS服务器上托管了这个应用程序。获取错误加载资源失败:服务器响应状态为500(内部服务器错误)。 但是当我在visual studio开发服务器上运行应用程序时它工作正常