你为什么不缓存电话的响应?
var cacheData;
$.post({.....
success: function(data){
if (data !== cacheData){
//data has changed (or it's the first call), save new cache data and update div
cacheData = data;
$('#yourdiv').html(data);
}else{
//do nothing, data hasan't changed
Run Code Online (Sandbox Code Playgroud)
这只是一个例子,您应该根据自己的需要(以及返回的数据结构)进行调整
| 归档时间: |
|
| 查看次数: |
1828 次 |
| 最近记录: |