G'所有,
我试图将值传递给原始AJAX调用中的Success var。
这里有一些代码:
function isJobComplete(jobGUID) {
var data = { "pJobGUID": jobGUID };
var url = '/DataService.asmx/isJobComplete';
var success = function (response, jobGUID) {
if (response.d) {
//The job is complete. Update to complete
setJobComplete(jobGUID);
}
};
var error = function (response) {
jAlert('isJobComplete failed.\n' + response.d);
};
sendAjax(data, url, success, error);
}
function sendAjax(data, url, success, error) {
$.ajax({
type: "POST",
url: url,
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: success,
error: error || function (response) {
jAlert(response.d);
}
});
}
当的isJobComplete功能运行时,它通过具有用于jobGUID在第一道次的正确的值,但在AJAX调用后返回成功,jobGUID变化到字"成功&#34 ;,与双引号。
如何将jobGUID传递给Success函数,以便根据AJAX响应使用它来完成更多工作?
提前致谢....