Results 1 to 8 of 8

Thread: Error: [Ext.getBody] document.body does not exist at the point

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
      0  

    Default Answered: Error: [Ext.getBody] document.body does not exist at the point

    What are some possible general causes and solutions to this error message?
    "Error: [Ext.getBody] document.body does not exist at the point "

    With a quick google search I found this:
    http://www.sencha.com/forum/showthre...n-using-define

    and this Sencha code:
    Code:
    /**
         * Returns the current document body as an {@link Ext.Element}.
         * @return Ext.Element The document body
         */
        getBody: function() {
            if (!Ext.documentBodyElement) {
                if (!document.body) {
                    throw new Error("[Ext.getBody] document.body does not exist at this point");
                }
    
                Ext.documentBodyElement = Ext.get(document.body);
            }
    
            return Ext.documentBodyElement;
        },

    But I am not calling Ext.getBody() and if I move my initial view that is created with Ext.create from launch to onReady in Ext.application then I get several other errors related to things not being created yet.

    For my situation the app works perfectly fine in chrome on a pc but on mobile devices I get a blank screen and the error.

  2. Ext.Viewport is always rendered to the body. You should not have any issues with this though. What environment are you seeing this issue?

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Ext.Viewport is always rendered to the body. You should not have any issues with this though. What environment are you seeing this issue?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
      0  

    Default

    It is happening on android and ios.... everything works with no errors in chrome on a pc....

  5. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
      0  

    Default

    Also, I have removed all references to .js files except the app.js and sencha-touch-all.js and commented out everything except the viewport config in Ext.Application and I still get the error on mobile devices...... and when running it on a PC the js debugger only shows those 2 files as being loaded..... does that mean that all other files aren't affecting this error? or could they be?

  6. #5
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Only the files loaded will be executed
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  7. #6
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
      0  

    Default

    Ok!!!

    Thanks to your reply, I figured it out. I recently removed the body tags from my index.html... not sure why.... but apparently since they didn't exist the viewport didn't have anywhere to get loaded into... IDK.... but its working now..... It is definitely odd that it would work on a PC but not a phone or tablet/ipad.

  8. #7
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Certain browsers will accomodate different things. Like trailing commas are invalid JavaScript but al browsers except IE will disregard it.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  9. #8
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
      0  

    Default

    So it seems that PC browsers are more forgiving than their possibly lighter mobile counterparts.

Posting Permissions

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