Javascript stops when iPad is locked

僤鯓⒐⒋嵵緔 提交于 2020-01-16 21:35:51

问题


I have a site which I've saved to my Home screen on the iPad.

When I open it, the site works fine and the full functionality can be used.

However, when I lock the iPad then unlock it and go back to the site all ajax requests stop working.

The ajax I'm using is pretty standard:

    $.ajax({
        type: method,
        url: action,
        data: $(this).serialize(),
        error: function(error) {
            alert(error);
        },
        success: function(json) {

            //do things

        }
    });

Is there any way around this? Refreshing the page doesn't work, and the problem doesn't occur when I load it directly in Safari, then lock and unlock. It's only when the site has been saved to the home screen.

来源:https://stackoverflow.com/questions/26125503/javascript-stops-when-ipad-is-locked

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!