Sencha Touch未捕获typeError:undefined不是一个函数 [英] Sencha Touch Uncaught typeError: undefined is not a function

查看:168
本文介绍了Sencha Touch未捕获typeError:undefined不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始检查Sencha Touch。在以下的教程中,我遇到了一些我似乎无法解决的问题。



从sencha提供的一些app.js中的基本代码运行正常。其他人似乎会得到错误。例如:

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

这样我得到一个:未捕获typeError:undefined不是一个函数



如果我在开始时重写没有新的代码,如下所示:

  Ext.application({
名称:NotesApp,
启动:function(){
console.log(App Launch);
}
});

我得到未捕获类型错误:对象#没有方法'应用程序'



第二种方式是在查看sencha时看到的地方,但似乎正在给我发问题。任何人都可以帮助我了解我在做错什么。



谢谢。

解决方案

看起来Ext.Application有一个大写A.记住Javascript是区分大小写的。



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


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 .

解决方案

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

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

这篇关于Sencha Touch未捕获typeError:undefined不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆