Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Default JavaScript execution exceeded ( iPhone 3G )

    JavaScript execution exceeded ( iPhone 3G )


    Hi,

    Sencha Version: 2.0
    Device : iPhone 3G
    Browser: safari

    I converted my app into production mode and the size of my app.js file is 720 KB, this means that my app is a big one so when I open my app on safari in iPhone 3G I get this error "JavaScript execution exceeded timeout", On refreshing several times the application shows up but most of the time I get this error, I am not sure why this is happening, the application works fine on iPad and iPhone 4.

    Any help is appreciated.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,206
    Vote Rating
    856
    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


    What iOS version is on your iPhone 3G?
    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.

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Default


    OS version is 4.1 (8B117)

  4. #4
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    There still shouldn't be so much execution time that would trigger that problem. I wonder if it's the caching on that device from localstorage. Can you try turning that off in your app.json file?

    Sencha Inc

    Jamie Avins

    @jamieavins

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Default


    How can I turn off local storage cache in app.json ?

  6. #6
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Default


    Here is my app.json file

    Code:
    {
        /**
         * The application's namespace, used by Sencha Command to generate classes
         */
        "name": "Application",
    
    
        /**
         * List of all JavaScript assets in the right execution order.
         * Each item is an object with the following format:
         *      {
         *          "path": "path/to/script.js" // Relative path to this app.json file
         *          "update": "delta"           // (Optional)
         *                                      //  - If not specified, this file will only be loaded once, and
         *                                      //    cached inside localStorage until this value is changed.
         *                                      //  - "delta" to enable over-the-air delta update for this file
         *                                      //  - "full" means full update will be made when this file changes
         *
         *      }
         */
        "js": [
            {
                "path": "sdk/sencha-touch.js"
            },
            {
                "path": "resources/js/jquery-1.3.2.min.js"
            },
            /*{
                "path": "resources/js/touch-charts.js"
            },*/
            {
                "path": "app.js",
                "update": "full"
            }
           
        ],
    
    
        /**
         * List of all CSS assets in the right inclusion order.
         * Each item is an object with the following format:
         *      {
         *          "path": "path/to/item.css" // Relative path to this app.json file
         *          "update": "delta"          // (Optional)
         *                                     //  - If not specified, this file will only be loaded once, and
         *                                     //    cached inside localStorage until this value is changed to either one below
         *                                     //  - "delta" to enable over-the-air delta update for this file
         *                                     //  - "full" means full update will be made when this file changes
         *
         *      }
         */
        "css": [
            {
                "path": "resources/css/m.css",
                "update": "full"
            }/*,
           {
                "path": "resources/css/touch-charts.css",
                "update": "full"
            }*/
        ],
    
    
        /**
         * Used to automatically generate cache.manifest (HTML 5 application cache manifest) file when you build
         */
        "appCache": {
            /**
             * List of items in the CACHE MANIFEST section
             */
            "cache": [
                "index.html"
            ],
            /**
             * List of items in the NETWORK section
             */
            "network": [
                "*"
            ],
            /**
             * List of items in the FALLBACK section
             */
            "fallback": []
        },
    
    
        /**
         * Extra resources to be copied along when build
         */
        "extras": [
            "resources/img",
            "resources/icons",
            "resources/loading"
        ],
    
    
        /**
         * Directory path to store all previous production builds. Note that the content generated inside this directory
         * must be kept intact for proper generation of delta between updates
         */
        "archivePath": "archive",
    
    
        /**
         * Default paths to build this application to for each environment
         */
        "buildPaths": {
            "testing": "build/testing",
            "production": "build/production",
            "package": "build/package",
            "native": "build/native"
        },
    
    
        /**
         * Build options
         */
        "buildOptions": {
            "product": "touch",
            "minVersion": 3,
            "debug": false,
            "logger": "no"
        },
    
    
        /**
         * Uniquely generated id for this application, used as prefix for localStorage keys.
         * Normally you should never change this value.
         */
        "id": "ded8b050-6ebe-11e1-b99d-8155f85dc34f"
    }
    What should I do to disable local storage caching.

  7. #7
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Let me verify and get back with you.

    Sencha Inc

    Jamie Avins

    @jamieavins

  8. #8
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Instead of doing a production build, do a package build (sencha app build package). This should avoid the microloader completely.

    Sencha Inc

    Jamie Avins

    @jamieavins

  9. #9
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Default


    Thanks Jamie, By doing this my application is now working on iPhone 3G, but it is slow as compared to the production mood any idea how can I use production mood ?

    Again thanks for your guidance.

  10. #10
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    The only real difference there is the caching in localstorage. Apple did a lot in iOS5 to speed up the javascript engine, it's a shame that they didn't give it to the older 3G. Perhaps breaking your application into 2 files would help.

    Sencha Inc

    Jamie Avins

    @jamieavins