简体   繁体   English

未捕获的TypeError:无法调用null的方法“观察” /未捕获的ReferenceError:未定义可拖动

[英]Uncaught TypeError: Cannot call method 'observe' of null / Uncaught ReferenceError: Draggable is not defined

I've been all over the related questions but couldn't find an answer to my problem. 我到处都是相关的问题,但是找不到我的问题的答案。

http://s1308.hizliresim.com/1d/5/r50lw.png http://s1308.hizliresim.com/1d/5/r50lw.png

When I click "Kredi Yükle" a popup should appear but nothing happens and i get these console errors. 当我单击“ KrediYükle”时,将出现一个弹出窗口,但什么也没有发生,并且出现这些控制台错误。

What should i do? 我该怎么办?

In related js file : 在相关的js文件中:

CreditLoadingAmrEditor = Class.create({
SELECTION_WINDOW    : "wndCreditLoadingHelper",
BUTTON_OK           : "btnLoadCreditOk",
BUTTON_CANCEL       : "btnLoadCreditCancel",
CREDIT_AMOUNT       : "fld_credit_amount",

initialize: function(owner) {
    this.owner              = owner;
    this.browser            = owner.browser;
    this.buttonOk           = $(this.BUTTON_OK);
    this.buttonCancel       = $(this.BUTTON_CANCEL);
    this.selectionWindow    = this.initializeHelper(this.SELECTION_WINDOW);
    var containers = $$("div[id='loadingCreditContainer']");
    if (containers && containers.size() > 0) {
        this.container      = containers[0];
        this.editorManager  = new EditorManager("loadingCreditContainer");
        this.creditAmount   = $(this.CREDIT_AMOUNT).instance;
    }
    this.browser.addToolClickListener(this);
    this.buttonOk.observe(iconstants.KEY_CLICK, this.okClick.bindAsEventListener(this));
    this.buttonCancel.observe(iconstants.KEY_CLICK, this.closeClick.bindAsEventListener(this));
},

initializeHelper: function(windowName) {
    var result = $(windowName);
    if (result){
        result.remove();
        document.body.appendChild(result);
    }
    return result;
},

toolClick: function(browser, toolType) {
    if (toolType == browser.TOOL_LOAD_CREDIT) {
        this.show();
    }
    return false;
},

show: function(callback) {
    this.callback = callback;
    FSystem.registerWindow(this.selectionWindow, true, true);
},

hide: function() {
    FSystem.unregisterWindow(this.selectionWindow);
},

okClick: function() {
    if (this.creditAmount.getValue() >= 0) {
        this.hide();
        this.requestForLoadingCredit();
    } else {
        window.alert(localize("value_must_greater_than_0"));
    }
},

closeClick: function() {
    this.hide();
},

requestForLoadingCredit: function() {
    FSystem.startWait();
    new Ajax.Request(
            iconstants.URL_CREDIT_LOADING_AMR,
            {
                method      : iconstants.METHOD_POST,
                parameters  : {mid:this.browser.getSelectedId(),ca:this.creditAmount.getValue()},
                onComplete  : this.responseForDeviceReading.bind(this),
                onException : null
            });
},

responseForDeviceReading: function(transport) {
    FSystem.stopWait();
    var JSON = transport.responseText.evalJSON();
    if (JSON.status == iconstants.AJAX_STATUS_OK){
        //if (confirm(JSON.message)) {
        window.open(JSON.url, '_newtab', 'width=1280,height=800');
        //}
    } else {
        alert(JSON.message);
    }
}

}); });

Such type of error occur when your object is not initialized. 当您的对象未初始化时,会发生此类错误。 You are trying to access a method of such object which is not initialized. 您正在尝试访问未初始化的此类对象的方法。 Please check your object initialization. 请检查您的对象初始化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的TypeError:无法调用null的方法“ appendChild”? - Uncaught TypeError: Cannot call method 'appendChild' of null? 未被捕获的TypeError:无法调用null的方法'getElementsByTagName' - Uncaught TypeError: Cannot call method 'getElementsByTagName' of null 未捕获的TypeError:无法调用null的方法“提交” - Uncaught TypeError: Cannot call method 'submit' of null 未捕获的TypeError:无法调用null的方法'replaceChild' - Uncaught TypeError: Cannot call method 'replaceChild' of null 未捕获的TypeError:无法调用null的方法“ menuAim” - Uncaught TypeError: Cannot call method 'menuAim' of null 未捕获的TypeError:无法调用null的方法'replace' - Uncaught TypeError: Cannot call method 'replace' of null 未捕获的TypeError:无法调用null的方法“ show” - Uncaught TypeError: Cannot call method 'show' of null 未捕获的TypeError:无法调用null的方法“ get” - Uncaught TypeError: Cannot call method 'get' of null 未捕获的TypeError:无法读取null的属性“ observe” - Uncaught TypeError: Cannot read property 'observe' of null 我不断收到Uncaught ReferenceError:未定义dropMenu和Uncaught TypeError:无法读取null的属性'style' - i keep getting Uncaught ReferenceError: dropMenu is not defined and Uncaught TypeError: Cannot read property 'style' of null
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM