Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Getting Error: Ext.onReady is not a function

  1. #1

    Default menus.html does not run on my server

    I installed extJS and can copy some of the demos to my server and run them ok (although I get a lot of Declariation dropped warnings). Menus.html does not run like on the website demo page. When I copy the code onto my server and run menus.html I get the following screen display:
    Toolbar with Menus

    The js is not minified so it is readable. See menus.js.

    In other words, I don't actually see any of the menu images.

    (1) I assume I don't have some path set correctly in my menus.html code?

    (2) What does the minified statement mean?

    Thanks...

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    1) Everything should just work out of the box, unzip it and that's it. Have you changed something?

    2) Minifying means stripping out comments and unnecessary whitespace to make the file smaller to download. It can also mean replace variable names from longer ones to shorter ones.

    For comparison, see ext-all.js vs ext-all-debug.js
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3

    Default

    No, I changed absolutely nothing in the menus.html file. I coped it from the examples folder into my editor and then I did an FTP upload from my editor to my severs public_html folder which is my 'root' folder where my .html files are.

    I installed extJS into public_html/js/ext-2.1/ folders. The structure starts from there so public_html/js/ext-2.1/examples/menu/menus.html is my complete path. I have not edited the menus.html script at all.

    Here is the difference that I can see:

    mywebsite.com/js/ext-2.1/examples/menu/menus.html runs the menus.html script fine - I can see the menus.

    mywebsite.com/menus.html does not run it ok - I cannot see the menus. So there is some path modifications that I need to make so the images can be found on my server path structure correct?

    Note 1: in my /examples folder there is a file called 'examples.jsb' but I do not see an 'examples.js' file. There is a line (23) in the menus.html file:

    PHP Code:
    <script type="text/javascript" src="../shared/examples.js"></script> 
    ...but I don't see a shared folder in my path structure nor do I see the examples.jsb file.

    Note 2: There is another line (13) in the menus.html file:

    [php
    <script type="text/javascript" src="../ext-all.js"></script>
    [/php]

    ...but when I look in my ../js/ext-2.1/adapter/ext/ folder there is only one file in there: 'ext-base.js'. I see no file named 'ext-all.js'.

  4. #4

    Default Getting Error: Ext.onReady is not a function

    I'm trying to run the menus.html demo and I'm getting an error msg:

    Error: Ext.onReady is not a function
    Source File: http://mywebsite.com/js/ext-2.1/examples/menu/menus.js
    Line: 9

    The only changes I had to make was in lines 10 and 13 - they orginally had 'ext-all.js' but my installation (the latest from ext download page) does not have that filename, it has 'ext-base.js' so that is what I am using. I am not certain this is causing the error but since ext-all.js did not exist, I thought it right to edit the filename to the one that is in that folder:

    PHP Code:
    <script type="text/javascript" src="../js/ext-2.1/adapter/ext/ext-base.js"></script> 
    Here is my complete menus.html file:

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <
    html>
    <
    head>
    <
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <
    title>Toolbar with Menus</title>
    <
    link rel="stylesheet" type="text/css" href="../js/ext-2.1/resources/css/ext-all.css" />
        <!-- 
    GC -->
      <!-- 
    LIBS -->
      <
    script type="text/javascript" src="../js/ext-2.1/adapter/ext/ext-base.js"></script>
      <!-- ENDLIBS -->
        <script type="text/javascript" src="../js/ext-2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="../js/ext-2.1/examples/form/states.js"></script>
    <script type="text/javascript" src="../js/ext-2.1/examples/menu/menus.js"></script>
    <link rel="stylesheet" type="text/css" href="../js/ext-2.1/examples/menu/menus.css" />
    <!-- Common Styles for the examples -->
    <link rel="stylesheet" type="text/css" href="../js/ext-2.1/examples/shared/examples.css" />
    </head>
    <body>
    <script type="text/javascript" src="../js/ext-2.1/examples/shared/examples.js"></script><!-- EXAMPLES -->
    <h1>Toolbar with Menus</h1>
    <p>The js is not minified so it is readable. See <a href="../js/ext-2.1/examples/menu/menus.js">menus.js</a>.</p>
    <div id="container">
        <div id="toolbar"></div>
    </div>
    <br /><br /><br /><br /><br />
    </body>
    </html> 

  5. #5

    Default

    I suggest down loading 2.1 again as ext-all.js is most definately in the distribution.

  6. #6

  7. #7

    Default

    Quote Originally Posted by mjlecomte View Post
    Read the FAQ:
    http://extjs.com/learn/Ext_FAQ#What_...cript_files.3F

    You haven't included the files correctly.
    I took the menus.html from the examples area - are you saying they don't have the correct incude order already? I don't know enough about ext to write an .html file on my own that includes using ext so that's why I chose to start with one of the samples: menus.html.

    In any event, I read the link you provided and the INCLUDE_ORDER.txt file and I'm sorry to say I'm still lost - I don't know what that file means as it lists several JS framework files - I assume you only need one and I thought I was using the ext stand alone but now I'm not so sure of anything. Do I need yahoo and/or jquery and/or prototype as well in order to use ext?

    (Sorry I'm so lost on this)

  8. #8

    Default

    Try this one instead...

    Follow the instructions explicitly..don't skip steps. You'll be up and running in no time.

    Here's the link...http://extjs.com/learn/Tutorial:Introduction_to_Ext_2.0

    Randy

  9. #9
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996

    Default

    Well, if you download the framework, the zip file already includes all of the examples already packaged up. You should not be downloading anything individually.

  10. #10
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    Of course the first works and the second doesn't. If you're modifying the structure, then the include paths will be wrong.

    There's no need for 2 threads about the same topic.

    It's quite obvious your include order is wrong.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •