我在http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap/关注SenchaTouch / PhoneGap教程 我正处于初始化SenchaTouch应用程序的阶段,我的HTML是:
<!DOCTYPE html><html>
<head>
<title>Contacts</title>
<script type="text/javascript" src="lib/touch/sencha-touch.js"></script>
<link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="cordova-2.5.0.js"></script>
<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript" src="app/views/Viewport.js"></script>
<script type="text/javascript">
document.addEventListener("deviceready", app.mainLaunch, false);
</script>
</head><body></body></html>
但是当我执行时:
Ext.regApplication({
name: 'app',
launch: function() {
console.log('launch');
}});
我明白了:
TypeError: 'undefined' is not a function (evaluating 'Ext.regApplication({ name: 'app', launch: function() { console.log('launch'); } })')
line: 6
message: "'undefined' is not a function (evaluating 'Ext.regApplication({↵ name: 'app',↵ launch: function() {↵ console.log('launch');↵ }↵})')"
stack: "eval code↵eval@[native code]↵_evaluateOn↵↵_evaluateAndWrap↵↵evaluate↵↵[native code]"
__proto__: Error
有关如何解决此问题的任何建议吗?
答案 0 :(得分:2)
不应该是这样的:
Ext.application({
name: 'app',
launch: function() {}
});
而不是Ext.regApplication