2012-12-27 36 views
1

我學習ExtJS的,並寫了一個演示與Extjs4.2,但沒有奏效ExtJS的不能工作

<html> 
<head> 
<title>A Simple JavaScript Function Example</title> 

    <style type="text/css" href="css/ext-all.css"></style> 
    <script type="text/javascript" src="js/ext.js"></script> 
</head> 

<body> 
<script type="text/javascript"> 
Ext.application({ 
    name: 'HelloExt', 
    launch: function(){ 
     Ext.create('Ext.container.Viewport', { 
      layout: 'fit', 
      items: [ 
       { 
        title: 'Hello Ext', 
        html : 'Hello! Welcome to Ext JS.' 
       } 
      ] 
     }); 
    } 
}); 
</script> 
</body> 

</html> 

,它顯示enter image description here

和「分機對應的地方。 JS:18" 是 enter image description here

回答

1

嘗試更換這一行:
<script type="text/javascript" src="js/ext.js"></script>

對此:
<script type="text/javascript" src="js/ext-all.js"></script>

另一件事,請嘗試在單獨的文件中編寫您的應用程序。內聯腳本是不行的。

+2

如果您不打算使用動態加載,ext-all-debug.js始終是開發的更好選擇。 –

+0

非常感謝,解決了。 – cleverUtd