Skip to content

Instantly share code, notes, and snippets.

@htom78
Created August 30, 2011 08:16
Show Gist options
  • Save htom78/1180449 to your computer and use it in GitHub Desktop.
Save htom78/1180449 to your computer and use it in GitHub Desktop.
ajax page loader
function cat_refresh(cat_id) {
jQuery("#grid-wrapper").load("http://www.miimoo.com/?page_id=2&cat=" + cat_id, function(msg) {
jQuery('#grid-wrapper').html(msg);
jQuery('#grid-pagination').html(jQuery('#grid-pagination-cat').html());
jQuery('#grid-pagination-cat').hide();
jQuery('#grid-wrapper').vgrefresh(null, null, null, function(){
jQuery(this).fadeIn(300);
});
jQuery('#single-wrapper').slideUp();
});
}
showall.me
function fetch(page_no,params,url,e){
var loading = $('<div class="loading"><img src="/medias/images/utils/loading06.gif" align="absmiddle" /><span style="margin-left:10px;">正在加载...</span></div>').modal();
$.ajax({
cache: false,
url: url,
type: 'GET',
data: params,
dataType: 'html',
async:true,
timeout: 200000,
beforeSend: function(){
$(e).html('');
loading.open();
},
complete: function(){
loading.close();
},
error: function(){
alert('错误!')
},
success: function(html){
$(e).html(html);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment