1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
    Soenhay is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Answers
    3491
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
    Soenhay is on a distinguished road

      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
    Soenhay is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Answers
    3491
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Only the files loaded will be executed
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #6
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
    Soenhay is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Answers
    3491
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Certain browsers will accomodate different things. Like trailing commas are invalid JavaScript but al browsers except IE will disregard it.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  9. #8
    Sencha User
    Join Date
    Feb 2012
    Posts
    67
    Answers
    3
    Vote Rating
    1
    Soenhay is on a distinguished road

      0  

    Default


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

Thread Participants: 1