Skip to content

Instantly share code, notes, and snippets.

@doubledouble
Created August 6, 2012 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doubledouble/3276768 to your computer and use it in GitHub Desktop.
Save doubledouble/3276768 to your computer and use it in GitHub Desktop.
jQuery.ajax
//得到整个页面,用于列表页面读取
function getPage(url,param,div){
//对中文进行编码
param = encodeURI(param);
document.getElementById(div).innerHTML = "<div style=\"text-align:center; line-height:30px; padding-top:50px;\"><img src=\"/2011/images/down/loading.gif\" width=\"66\" height=\"66\" /><br />数据正在加载中,请稍等……</div>";
jQuery.ajax({
type:"GET",
url:url+"?div="+div+param,
async: true,
dataType: "html",
success: function(data){
document.getElementById(div).innerHTML = data;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment