开发者

Ext is not defined issue in Ext Js

I'm new to Ext Js. I have following file structure.

Ext is not defined issue in Ext Js

And I'm testing following code -

   <html>
   <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>First Ext Js Page</title>
    <link rel="stylesheet" href="../ext-3.3.1/resources/css/ext-all.css">
     <script type="text/javascript" src="../ext-3.3.1/adapter/ext/ext-base.js"></script>
     <script type="text/javascript" src="../ext-3.3.1/ext-all.js"></script>
     <script type="text/javascript" src="../ext-3.3.1/adapter/ext/ext-base-debug.js"></script>
      <script type="text/javascript">
       Ext.BLANK_IMAGE_URL = '../ext-3.3.1/resources/images/default/s.gif';
    Ext.onReady(function (){
    alert('done');
    });
  </script>
</head>
  <body>
 </body>
 </html>

But it is giving me errors as

  1. Ext.onReady is not a function,

  2. Ext.EventManager is undefined, and multiple times

  3. Ext.Event开发者_如何学CObject is undefined

How can I fix this.


The reason is you included the ext-base-debug.js (debug version) after ext-all.js.

Use either:

<script type="text/javascript" src="../ext-3.3.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext-3.3.1/ext-all.js"></script>

or

<script type="text/javascript" src="../ext-3.3.1/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="../ext-3.3.1/ext-all-debug.js"></script>


ext library has be loaded once only.. If you load these library twice on basic and child page again..you will get this error. Please remove duplicate js files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜