开发者

Is there a way using jQuery to stagger PHP queries in a page?

开发者 https://www.devze.com 2023-03-14 15:09 出处:网络
There is a page with several php queries being called... each php query pulls data from the db to create an analytics graph.Initially, was thinking about using the jQuery lazy loader plugin... however

There is a page with several php queries being called... each php query pulls data from the db to create an analytics graph. Initially, was thinking about using the jQuery lazy loader plugin... however, do not believ开发者_运维知识库e it will work in this context.

What I want to do is when a user is looking at the first graph (before scrolling down), that it will make an AJAX call and run the php Query, show a loading gif, and then finally display the graphics/graph for the outputted query... as the user continues to scroll down, more queries will be called. The issue now is that the page calls all the queries at once and it takes a while to load.

Any thoughts on how to do this using javascript, jQuery, or any other lazy loading technique?


http://imakewebthings.github.com/jquery-waypoints/


Dunno how you can generate different graph within only one page.

Anyway you need to do something like this:

<img src="graph1.php">
[page]
<img src="graph2.php">
<img src="graph3.php">
[ more more page ]
<img src="graph4.php">

In this way you have differnet page that will build up differnet graph as the user scrolls down. And you can use lazy loading here.

0

精彩评论

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