我试图找到正确的语法以将变量传递给我的JQuery Post。
var id = empid; $.ajax({ type: "POST", url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders", data: "{empid: empid}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(result) { alert(result.d); }
我不认为数据:价值是正确的。有人让我挺直吗?
谢谢!
这个怎么样:
var id = empid; $.ajax({ type: "POST", url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders", data: "{empid: " + empid + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(result){ alert(result.d); console.log(result); } });