iOS safari crashing (a problem repeatedly occured)

前端 未结 5 1896
春和景丽
春和景丽 2021-02-14 21:47

I\'m developing a website and have recently run into a problem when testing on my iPhone X - the site wont load.

Safari tries to load it, then reports the error \'this

5条回答
  •  礼貌的吻别
    2021-02-14 22:14

    I have “solved” this by assuming this is indeed a memory problem and setting display:none to elements not visible in the viewport (by using a window on-scroll event).

    https://medium.com/talk-like/detecting-if-an-element-is-in-the-viewport-jquery-a6a4405a3ea2

    This fixed the crashing in safari on my iPhone X. However it does not explain why this was occurring in the first place on a powerful device when the web app consumes under 20mb of memory and it ran fine on any other less powerful device I could find.

提交回复
热议问题