php - Jquery POST to refresh a div -



php - Jquery POST to refresh a div -

i want utilize $.post function of jquery div refresh, if content returned in json info php script modified. know ajax calls $.post never cached. please help me $.post, or $.ajax if not possible $.postor other method possible.

thanks

why don't cache response of call?

var cachedata; $.post({..... success: function(data){ if (data !== cachedata){ //data has changed (or it's first call), save new cache info , update div cachedata = data; $('#yourdiv').html(data); }else{ //do nothing, info hasan't changed

this example, should adapt suit needs (and construction of info returned)

php jquery ajax json

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -