开发者

Can I load data with jQuery without the browser showing that things are loading?

When my site first loads, there's an array being filled with information from a database that I'm grabbing with jQuery (from google fusion tables). There's a lot of info, so it takes a good 3 - 10 seconds bas开发者_如何学Goed on how things are going. It's not needed right away, and the rest of the page loads up. My issue is that the browser icon is still spinning and the mouse is spinning (hourglass, whatever). Makes sense, things are still loading, but I don't want the user to feel like they're still waiting when they're actually good to go. Is there a way to stop this behavior?


I think you should split your process function to 2 parts: 1) the main process (long queries...) and 2) ajax function to check that main process's result. (you can store the result in file, db or memcache...)

Then it only takes a few ms to go back to the server to check for the result. Users won't see loading cursor anymore.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜