我在jQgrid验证的自定义函数中使用了ajax调用,
这是我的功能
function customFuction(value1, colname) {
var result = null;
$.ajax({
url: "../ajax/check_269.php",
type: "POST",
data: {
val: value1,
col: colname,
parentId: row_id
},
dataType: "html",
async: false,
success: function (data) {
if (data == "error") {
result[false, value1 + "no se permite"];
} else {
result[true, value1 + "Success"];
}
},
error: function () {
alert('Error trying to validate car ');
}
});
return result;
}
它给了我这样的错误
TypeError: result is null