1 $.ajax({ 2 url: "/Handler/CheckName", 3 type: "post", 4 async: false, 5 data: { name: name }, 6 success: function (data) { 7 if (data != "") { 8 var model = eval("(" + data + ")"); 9 if (model.state == 1) { 10 result = true; 11 } 12 else { 13 result = false; 14 msg = model.msg; 15 } 16 } 17 } 18 })