jQuery load()方法的封装

来源:互联网 发布:淘宝淘女郎认证范文 编辑:程序博客网 时间:2024/05/15 23:52
function load(url,data,callback){if(data){xhr.open("post",url);xhr.setRequestHeader();//JSON对象转换为JSON字符串}else{xhr.open("get",url);}xhr.onreadystatechange=function(){callback(xhr.responseText);}}

0 0