Welcome Guest, Not a member yet? Register   Sign In
Best way to set up AJAX/JQuery process?
#5

(02-16-2015, 05:19 PM)includebeer Wrote: The way I prefer to do it is with a table containing an empty "tbody". Then all the rows are build by JS. I have no duplication of code for the rows and the page loads a little faster because it display static html, then after the ajax call has finished the table is filled. In the end it's not faster but I prefer to look at a spinning icon for half a second than look at a blank page for the same amount of time ! Wink

I don't really see the point of loading the page faster just to display a broken table and a spinning icon until the page completes a second request for the data. After all, the data can be sent along with the page, even if you still want to build the table in JavaScript. The only real justification I can see for something like this would be in the case of a long-running query which is triggered by the first request (which then returns the page without the data) and cached until the second request is received. Doing something like that tends to be uncommon in PHP, for various reasons.
Reply


Messages In This Thread
RE: Best way to set up AJAX/JQuery process? - by mwhitney - 02-17-2015, 09:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB