日期:2014-05-16 浏览次数:20677 次
ajax.get = function ( url, fn , async ){ if(ajax.xmlHttp == null) { alert ("您得瀏覽器不支持AJAX!"); return false; } async = async || true; ajax.xmlHttp.open( "GET", url, async ); ajax.xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=utf-8"); ajax.xmlHttp.onreadystatechange = fn; ajax.xmlHttp.send(); }
ajax.get( encodeURI(encodeURI(url)) ,function(){ if (ajax.xmlHttp.readyState==4 && ajax.xmlHttp.status==200) { if( ajax.xmlHttp.responseText == 1) { window.location.reload(); } } }, true);