Forum Moderators: open

Message Too Old, No Replies

load content in Steps

php js ajax

         

jogisarge

8:11 am on Dec 17, 2014 (gmt 0)

10+ Year Member



Hello,

ich use php and js - no jquery
By clicking on a button i call a js funtion that creates a ajaxrequest an call a php script.
The php returns a "<table>" which is my content. I write the content in a div.

Because of the long loading times(php calls some webservices...) i search a solution for speeding up the load-sequence.
So i thought about splitting the return-content from php in Steps like returung the table-rows step by step.
But i have no idea how to do this.

should i run the ajax-call in JS in a loop and call it so often till the php return a endflag ?

by jogi

lammert

1:43 pm on Dec 21, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi Jogi,
Obviously the best option would be to optimize the the back-end system to decrease the time needed to generate the info for your table. Everything else you do will only optimize the first-byte-in-browser time, but it will not make your total load time better. In fact multiple ajax calls will probably slow down the whole process even more.