简体   繁体   中英

How to change page's html with ajax and jquery?

I would like to change the page in a mobile app. The window.location.href = 'sth.html' is works, but my problem is, the time between the change (when I see the white screen under changing).

I know with jQuery mobile it is very simple, but I don't want to use JQM.

Are you know some methods?

You can send an HTTP GET request to sth.html with AJAX and make sure you allow caching on the server.

Only after that request completes redirect.

That would cause the browser to load the page sth.html from its cache and not from your server and should effectively eliminate the white screen.

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