Uncaught ReferenceError: soapReq没有定义

Uncaught ReferenceError: soapReq is not defined

本文关键字:定义 soapReq ReferenceError Uncaught      更新时间:2023-09-26

为什么是soapReq 'undefined'?

var soapReq = GetFacilitiesSoapReq(sessionId);
console.log(soapReq)

function GetFacilitiesSoapReq(sessionId) {
    AbstractSoapReq.call(this); // invoke the super constructor
    this.getAjaxRequest = function() {
        var ajaxRequest = new GetFacilitiesAjaxReq();
        return ajaxRequest
    }
    this.getSOAPHead = function(sessionId) {
        return getSOAPHeadId(sessionId);
    }
    this.getSOAPBody = function() {
        return getSOAPBody("getFacilitiesForUser");
    } 
}
SignInSoapReq.prototype = Object.create(AbstractSoapReq.prototype);

我想把soapReq作为参数传递给一个函数

soapReq未定义,因为函数GetFacilitiesSoapReq没有返回任何内容。