开发者

Unable to run any async ajax requests after location.replace is called in webkit browsers

开发者 https://www.devze.com 2023-03-14 17:43 出处:网络
I have a loading page that uses location.replace to navigate to the result page. This request can take a long time, so it takes a while to return. In the meantime, I am using long-polling ajax request

I have a loading page that uses location.replace to navigate to the result page. This request can take a long time, so it takes a while to return. In the meantime, I am using long-polling ajax requests to update the loading page with progress information.

This works fine on Firefox and IE, it allows ajax requests to continue after location.replace is called.开发者_StackOverflow

But with webkit browsers (Chrome, Safari), all the ajax requests are canceled once the location.replace request is executed.

Is there a way to make ajax requests while the main window is navigating to another page in webkit browsers?


if your using ajax maybe you can download the page with a ajax call and just render its boddy into the active page and change the curent url witch webkit suports.

0

精彩评论

暂无评论...
验证码 换一张
取 消