简体   繁体   中英

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

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?

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. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM