Ok so I have a plugin that generate multiple widget fill with XML data from a ftp server. When the XML files are updated I need my widget to reload to be able to see the changes. My problem is the data of one of my XML only change every 24 hours so I don't need it to reload more than once a day. I temporary use location.reload() in a setInterval() function that reload every 30 sec.
var refreshTime = 30000;
setInterval( function( ) {
$.ajax( {
url: ajaxurl,
data:
{
action: 'refresh_handler'
},
success: function( result )
{
location.reload();
}
});
},
refreshTime );
My XML data are divide in my widget and I can post each section individualy so I also need it to reload if I click <-Back.
My question is can I reload my widget individually without having to reload my page every time? All the examples I see on the web are all about to reload my page or all my widget at the same time.
No comments:
Post a Comment