function refreshData() {
$("#report").load("bentonite.cfm?dataType=html"); // Loads the page via ajax and puts content into specified elements
return false;
};

$(function() { // $(fn) == $(document).ready(fn)
refreshData();
setTimeout(refreshData(), 3000);
$(refreshlink).click(refreshData);
});

Blair

On 9/19/06, Paul <[EMAIL PROTECTED] > wrote:

I'm just beginning to experiment with jQuery and need a little help.  I'm using it to display reference data for one of our production teams, and the data changes frequently throughout the day.  Here's what I've got, which works:

 

$(document) .ready( function() {

       $ .ajax({ type : "GET",

               url : "bentonite.cfm",

               dataType : "html",

               success : function(rpt){ $( "#report") .empty(); $( "#report" ) .append( rpt .responseText ); }

       }); 

});

 

This is fine, but I would like to call the ajax script at set time intervals after the initial load so the team will always have the most recent data on their terminal.  What is the best way to: a) load the report when the page loads; b) refresh the data every X seconds; and c) allow manual refreshing of the report by clicking an html link?

 

Thanks in advance,

 

Paul


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/



_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to