Javascript on ipad loads slowly

I have a basic html site (html5, JavaScript, jQuery) that I have running on iPpad2. I am doing basic testing with Google Chrome, just for checking image layouts and copying, etc. My real test, however, should be on the most modern iPad.

On the iPad, I seem to have a 2-4 second delay compared to Chrome, which loads instantly. I could not find a bottleneck. I have added warnings at different points in the code, but all warnings appear immediately, one after another, and it seems that a delay occurs after the last warning, which is located in the last line of code.

Warnings can be misleading, since perhaps the code is cached before it is executed? Is there something I should look for or avoid in my code to speed up the iPad?

+5
source share
2 answers

iPad is significantly slower than a desktop computer running Google Chrome. It was expected to take a little longer.

If it were 10-20 seconds, I would say check your code, but 2-4 seconds is not unreasonable for the page to load.

0
source

If you do not cache selector results - mobile devices are prone to poor performance

what i mean if you do this:

$("#someId").css(some, stuff);
$("#someId").css(other, stuffs);
$("#someId").attr(even, more);

compared with

var ourElement = $("#someId");
ourElement.css(some, stuff);
ourElement.css(other, stuffs);
ourElement.attr(even, more);

, " " - .. - .

+8

All Articles