开发者

How to display loading page before page with search results displays?

开发者 https://www.devze.com 2023-01-14 03:33 出处:网络
Usually when using any web page that is used to search for huge amount of data, like searching for cheap flights, user is first redirected to a page that shows progress bar e.g. \'Now Searching Multip

Usually when using any web page that is used to search for huge amount of data, like searching for cheap flights, user is first redirected to a page that shows progress bar e.g. 'Now Searching Multip开发者_Python百科le Travel Sites..', and when search on the server is done, then is redirected to actual search results.

How that is done? Is it some javascript/ajax trick?


Well you can easily set a function or event to trigger when the AJAX is finished loading. So on the submission of a form you can just set the page to display "loading..." then remove that to display the results or whatever once the AJAX is finished loading.


there are a few ways, one way as you suspect can be with javascript to show a div or some element with 'loading...' in it, on clicking a submit / search button. This will show up until the moment that the page refreshes with the page results.


There are lots jquery plugins which are really simple to use and allow customization in terms of the processing message you want to show. Here is one such Jquery plugin.

It is as simple as calling $blockUI() and $unblockUI() from javascript. You can check out the demo here.

0

精彩评论

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