这是我的javascript方法:
function AssignDebtor(e) {
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var debtorId = dataItem.Id;
$.post({
url: '@Url.Action("AssignDebtorToUnallocatedReceipt", "Debtor")',
data: new { unallocatedReceiptId : cdcUnallocatedReceiptId, debtorId : debtorId },
success: function (result, textStatus, jqXHR) {
if (result.success) {
var window = $("#LookupDebtorWindow").data("kendoWindow");
window.close();
var grid = $("#UnallocatedReceiptsGrid").data("kendoGrid");
grid.dataSource.read();
}
else {
alert(result.error);
}
},
dataType: 'json'
});
}
在运行时,调试器在 $.post 行停止,并返回此错误:
0x800a01bd - JavaScript 运行时错误:对象不支持此操作
deborId 成功获取它的值。我构建方法的方式可能存在问题吗?