Sencha Touch Uncaught typeError: undefined is not a function

99封情书 提交于 2019-12-10 21:34:00

问题


I have recently began to check out Sencha Touch. In following there tutorials I have ran into some issues that I cannot seem to resolve.

Some of the basic code in app.js that is provided from sencha runs fine. Others seem to get errors. For Example:

new Ext.application({
name: "NotesApp",
launch: function() {
        console.log("App Launch");
    }
});

With this I get an: Uncaught typeError: undefined is not a function

If I rewrite the code without new at the beginning like:

Ext.application({
name: "NotesApp",
launch: function() {
        console.log("App Launch");
    }
});

I get "Uncaught typeError: Object # has no method 'application'"

The second way is what I see all over the place when looking up sencha but it seems to be gining me issues. Can any one help me understand what I am doing wrong.

Thank you .


回答1:


Looks like Ext.Application has a capital A. Remember that Javascript is case sensitive.

http://docs.sencha.com/touch/1-1/#!/api/Ext.Application



来源:https://stackoverflow.com/questions/10888143/sencha-touch-uncaught-typeerror-undefined-is-not-a-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!