5

My javascript code stops when the side loads from the cache manifest in the Fullscreen WebApp Mode(iPad3/iOS6).

This has the consequence that you cant do anything in the first 5 seconds. After that you can use the site as normal.

1) Why does the JavaScript Code stop? (Event Problem?)
2) How can i fix it?

Involved is:

  • jquery-1.8.2.min.js

EDIT:

I have experimented and found out that the JavaScript code runs normally after the event onNoUpdate and onUpdateReady. Until these two events are initiated, it passes a large time. So this is not a option.

EDIT2:

`<script type="text/javascript">

    $(document).bind('touchmove', false);


    $(document).ready(function () {
        applicationCache.onupdateready = function () {
            if (confirm("Ihre Applikation wurde aktualisiert. Soll die Darstellung neu geladen werden?")) {
                window.location.reload();
            }
        }
        applicationCache.onnoupdate = function () {

        }


        var a = document.getElementsByTagName("a");
        for (var i = 0; i < a.length; i++) {
            if (a[i].className.match("noeffect")) {
                // Here happens nothing
            }
            else {
                a[i].onclick = function () {
                    load();
                    window.location = this.getAttribute("href");
                    return false;
                };
            }
        }
    }
);`
skull3r7
  • 215
  • 1
  • 4
  • 9

1 Answers1

0

Try inserting some logs in key spots to find out exactly where in the code the pause happens. Usually when you narrow it down enough, the answer becomes clear.

RonaldBarzell
  • 3,822
  • 1
  • 16
  • 23