0
我使用sencha創建了示例Blackberry WebWorks項目。它工作正常。 的代碼是:白色屏幕運行sencha +黑莓網絡應用程序
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" id="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no">
<title>Hello World</title>
<script src="www/sencha.js" type="text/javascript"></script>
<script src="www/cordova2.js" type="text/javascript"></script>
<link href="www/resources/css/app.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
new Ext.application({
launch: function() {
Ext.create('Ext.Panel', {
fullscreen: true,
items: [
{
dock : 'top',
xtype: 'toolbar',
title: 'My First Test App',
height:40
},
{
xtype : 'panel',
html:"test"
}
]
});
}
});
</script>
</head>
<body></body>
</html>
在這個項目中,我在這個文件中定義煎茶代碼。但是現在我想創建項目,使sencha代碼應該在單獨的文件中。但我越來越白屏。
誰能告訴我如何做到這一點?
我嘗試這樣做:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" id="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no">
<title>Hello World</title>
<script src="www/sencha.js" type="text/javascript"></script>
<script src="www/cordova2.js" type="text/javascript"></script>
<script src="www/app.js" type="text/javascript"></script>
<link href="www/resources/css/app.css" rel="stylesheet" type="text/css" />
</head>
<body></body>
</html>
的app.js代碼:
Ext.application({
name: 'SenchaDemo',
requires: [
'Ext.MessageBox'
],
views: ['SettingPanel'],
launch: function() {
// Initialize the setting view
Ext.Viewport.add(Ext.create('SenchaDemo.view.SettingPanel'));
},
onUpdated: function() {
Ext.Msg.confirm(
"Application Update",
"This application has just successfully been updated to the latest version. Reload now?",
function(buttonId) {
if(buttonId === 'yes') {
window.location.reload();
}
}
);
}
});
請幫助我。我花了一個多星期。但沒有得到爲什麼是這個錯誤。 – user1489812 2012-08-07 06:24:57
當我在index.html中定義sencha代碼,然後sencha代碼工作。但如果我在其他文件中定義了sencha,並將sencha cod efile引用到index.html十中,那麼它不起作用。 – user1489812 2012-08-07 07:16:26
顯式加載sencha組件的工作。但如果我在app.js中定義它不工作。請幫幫我。 – user1489812 2012-08-07 07:17:57