Mobile Safari (iPhone/iPad) crashes when large number of DOM elements inserted dynamically

Question!

We have an application which renders dynamic content following user interaction.

One call appends about 400 DOM elements to page following an AJAX call.

Works fine on desktop but iPhone/iPad scroll content slugglishly then eventually freeze before crashing completely.

If we load same amount of data on page load rather than dynamically, iPhone/iPad are able to handle it without issue.

I have a feeling it's because device allocates a certain amount of memory on load then dynamic insertion goes way over this which causes crash.

Any ideas?



Answers

my first suggestion will be try to use instruments that if the crash is occurring because of memory. and then if it is because of memory ,

maybe you should load some amount of DOM elements and like a lazy load you can get the remaining part-by-part?

hope this helps. :)

By : iremk


This video can help you solving your question :)
By: admin