JQuery refresh data

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
ccplusit
User
Posts: 102

JQuery refresh data

Post by ccplusit »

Anybody used JQuery or Ajax to refresh page data without reloading the whole page! I need a way of doing this as we have a lot of data and changes running in the background continually. Ideally a way of doing it from ether a time function or button click.

I see JQuery is in the file directory but not sure how to go about this.


mobhar
User
Posts: 11905

Post by mobhar »

Simply Google for "jquery refresh page without reload".


ccplusit
User
Posts: 102

Post by ccplusit »

I have googled and come up with this but no success, in the list page Client Script I have added

src="ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js//Full URL to ajax js

and in the Startup Script added

$(document).ready(function() {

$("#gmp_getaccountcdrs").fadeOut("fast").load("ad_getsubaccountcdrslist.php").fadeIn("slow");

var refreshId = setInterval(function() {
$("#gmp_getaccountcdrs").fadeOut("fast").load("ad_getsubaccountcdrslist.php").fadeIn("slow");
}, 50000);

$.ajaxSetup({ cache: false });

});

I was expecting the <div id="gmp_getaccountcdrs" class="ewGridMiddlePanel"> division to get reloaded but nothing seems to happen.

Any pointers welcome please.


ccplusit
User
Posts: 102

Post by ccplusit »

Ok sorted out the above and realised that what this would do would be to reload the whole page in to the gmp_getaccountcdrs Div. Is it possible to reload the table data only without complete refresh or is the structure generated not compatible for this sort of request.


mobhar
User
Posts: 11905

Post by mobhar »

ccplusit wrote:
Is it possible to reload the table data only without complete refresh
or is the structure generated not compatible for this sort of request.

You should generate a blank page without header and footer and write your own custom code in there in order to display the table data as you desired, afterwards, load that file inside your "gmp_getaccountcdrs" Div section.


Post Reply