如何在.NET MVC中使用jQuery并返回JSON数据
1个回答
展开全部
代码
function loadDoctorInfo(departmentID){
$.ajax({
url:"@Url.Content("~/Doctor/GetInfo")",
data:{departmentID:departmentID},
async:true,
success:function(result){
var source = $("#myTemplate").html();
var template = Handlebars.compile(source);
var html = template(result);
$("#myContainer").html(html);
},
error:function(result,errorInfo){
alert("加载医生信息失败");
}
function loadDoctorInfo(departmentID){
$.ajax({
url:"@Url.Content("~/Doctor/GetInfo")",
data:{departmentID:departmentID},
async:true,
success:function(result){
var source = $("#myTemplate").html();
var template = Handlebars.compile(source);
var html = template(result);
$("#myContainer").html(html);
},
error:function(result,errorInfo){
alert("加载医生信息失败");
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询