根源chinaz的ajax获取议论代码_javascript技艺_脚本之家www.js8331.com

ajax获取到的字符是肖似下边的故事情节复制代码
代码如下:{a:”

支持:[0]反对:[0]神州站长站网上好友:佚名于2010-04-贰十二位言啧啧道:

何人认为投放了谷歌(GoogleState of QatarAdSense的站点就不许举行推广了?傻蛋啊”,b:1}然后用下边包车型大巴ajax进行输出复制代码 代码如下:varkey=”; varstr=newArray(卡塔尔;
functioncreateAjaxObj(卡塔尔{ varhttprequest=false
//document.domain=’chinaz.com’;
if(window.XMLHttpRequest卡塔尔{//ifMozilla,Safarietc
httprequest=newXMLHttpRequest(卡塔尔(قطر‎ if(httprequest.overrideMimeType卡塔尔httprequest.overrideMimeType; } elseif{//ifIE try {
httprequest=newActiveXObject; } catch { try {
httprequest=newActiveXObject; } catch{} } } returnhttprequest; }
functionload_feedback{ /*
varurl=”;
varajax=newoAjax(卡塔尔国; //是不是出示错误 //ajax.error=true;
//乞求的页面包车型客车编码为’gb2312’或空 //ajax.encode=’gb2312′; //回调函数
ajax.callback=function{ //处理再次回到内容 eval;
document.getElementById.innerHTML=obj.a;
document.getElementById.innerHTML=obj.b; }; ajax.send; */
varxmlhttp=createAjaxObj(); try {
varparams=”action=show&arcID=”+arcID+”&pg=”+pg; xmlhttp.abort();
xmlhttp.open(“get”,”/plus/feedback_ajax.php?”+params,true);
xmlhttp.setRequestHeader(“Content-type”,”text/html;charset=gb2312″);
xmlhttp.setRequestHeader(“If-Modified-Since”,”0″);
xmlhttp.setRequestHeader(“Content-length”,params.length);
xmlhttp.setRequestHeader; xmlhttp.onreadystatechange=f xmlhttp.send{}
functionf() { if(xmlhttp.readyState!=4||xmlhttp.status!=200) return;
varb=xmlhttp.responseText; varobj=eval;
document.getElementById.innerHTML=obj.a;
document.getElementById.innerHTML=obj.b;
document.getElementById.innerHTML=obj.b; } } functionload_allfeedback{
varxmlhttp=createAjaxObj(); try {
varparams=”action=showall&arcID=”+arcID+”&pg=”+pg; xmlhttp.abort();
xmlhttp.open(“get”,”/plus/feedback_ajax.php?”+params,true);
xmlhttp.setRequestHeader(“Content-type”,”text/html;charset=gb2312″);
xmlhttp.setRequestHeader(“If-Modified-Since”,”0″);
xmlhttp.setRequestHeader(“Content-length”,params.length);
xmlhttp.setRequestHeader; xmlhttp.onreadystatechange=f xmlhttp.send{}
functionf() { if(xmlhttp.readyState!=4||xmlhttp.status!=200) return;
varcontent=xmlhttp.responseText; varobj=eval; //eval;
document.getElementById.innerHTML=obj.a;
//document.getElementById.innerHTML=obj.b; } } functionfeed_back(){
varmsg=trim(document.getElementById;
vararcID=document.getElementById.value;
varusername=trim(document.getElementById;
varpwd=trim(document.getElementById;
varcheckbox=document.getElementById; if varnotuser=1; else varnotuser=0;
varxmlhttp=createAjaxObj(); try {
params=”action=send&arcID=”+arcID+”&msg=”+msg+”&username=”+username
+”&pwd=”+pwd+”&notuser=”+notuser; xmlhttp.abort();
xmlhttp.open(“get”,”/plus/feedback_ajax.php?”+params,true);
xmlhttp.setRequestHeader(“Content-type”,”text/html;charset=gb2312″);
xmlhttp.setRequestHeader(“If-Modified-Since”,”0″);
xmlhttp.setRequestHeader(“Content-length”,params.length);
xmlhttp.setRequestHeader; xmlhttp.onreadystatechange=f xmlhttp.send{}
functionf() { if(xmlhttp.readyState!=4||xmlhttp.status!=200) return;
vararr=xmlhttp.responseText.split{ alert; } else{ if alert; alert;
load_feedback; } } } functiongoodbad{ varxmlhttp=createAjaxObj(); try {
params=”action=”+actname+”&f&arcID=”+arcid+”&pg=”+pg; xmlhttp.abort();
xmlhttp.open(“get”,”/plus/feedback_ajax.php?”+params,true);
xmlhttp.setRequestHeader(“Content-type”,”text/html;charset=gb2312″);
xmlhttp.setRequestHeader(“If-Modified-Since”,”0″);
xmlhttp.setRequestHeader(“Content-length”,params.length);
xmlhttp.setRequestHeader; xmlhttp.onreadystatechange=f xmlhttp.send{}
functionf() { if(xmlhttp.readyState!=4||xmlhttp.status!=200) return;
vararr=xmlhttp.responseText.split alert; else{ alert; load_feedback; }
} } functiongoodbad2{ varxmlhttp=createAjaxObj(); try {
params=”action=”+actname+”&f&arcID=”+arcid+”&pg=”+pg; xmlhttp.abort();
xmlhttp.open(“get”,”/plus/feedback_ajax.php?”+params,true);
xmlhttp.setRequestHeader(“Content-type”,”text/html;charset=gb2312″);
xmlhttp.setRequestHeader(“If-Modified-Since”,”0″);
xmlhttp.setRequestHeader(“Content-length”,params.length);
xmlhttp.setRequestHeader; xmlhttp.onreadystatechange=f xmlhttp.send{}
functionf() { if(xmlhttp.readyState!=4||xmlhttp.status!=200) return;
vararr=xmlhttp.responseText.split alert; else{ alert; load_allfeedback;
} } } functionpg{ vararcID=document.getElementById.value;
load_feedback; } functionpg2{ //vararcID=document.getElementById.value;
load_allfeedback; } functionck_yzimg(){ //document.all.cknum.value=”;
document.all.msg.value=”; document.all.username.value=”;
document.all.pwd.value=”;
document.getElementsByName[0].disabled=false;
//document.all.img1.onclick{ returns.replace.replace; } ////// /*
String.prototype.Contains=function{ return; }; varBrowser={
s:navigator.userAgent.toLowerCase{ b.IsIE=b.s.Contains;
b.IsIE5=b.s.Contains; b.IsIE6=b.s.Contains; b.IsIE7=b.s.Contains;
b.IsIE56=!b.IsIE7&&; b.IsGecko=b.s.Contains; b.IsSafari=b.s.Contains;
b.IsOpera=b.s.Contains; b.IsMac=b.s.Contains; b.IsIELike=;
b.IsGeckoLike=(b.IsGecko||b.IsSafari); }); functionoAjax(){
this.req=null; this.url=”; this.content=”; this.type=’text’;
this.encode=”; this.asyn=true; this.action=’get’; this.error=false; }
oAjax.prototype.init=function(){ if(window.XMLHttpRequest){
this.req=newXMLHttpRequest(); } elseif{ //isIE=true; try{
this.req=newActiveXObject; } catch{ try{ this.req=newActiveXObject; }
catch{ this.req=false; } } } varself=this; if{
this.req.onreadystatechange=function}; } };
oAjax.prototype.listener=function(){ if(this.req.readyState==4){ if{
//right try{
this.callback(Browser.IsIE&&this.encode==’gb2312′?oAjax.gb2utf8(this.req.responseBody):(this.type==’text’?this.req.responseText:this.req.responseXML));
} catch{ this.halt(‘[callback]’+e.name+’:’+e.message); } } else{
//error this.halt(‘[callbackerror]’+this.req.status); } } };
oAjax.prototype.send=function; url=this.url=url||this.url||”;
this.content=!!this.content?this.content:”;
this.encode=this.encode?this.encode.toLowerCase():”;
this.asyn=this.asyn==undefined?true:!!this.asyn;
this.action=(this.action==undefined||this.action==’get’)?’Get’:’Post’;
this.error=this.error==undefined?false:!!this.error; if{ alert; return;
} try{ this.req.open(this.action,url,this.asyn); } catch{
this.halt(‘[open]’+e.name+’:’+e.message); return; } try{
this.req.setRequestHeader;
this.req.setRequestHeader(‘Accept-Encoding’,’gzip,deflate’);
this.req.setRequestHeader(‘Content-Type’,’application/x-www-form-urlencoded’+(this.encode?’;charset=’+this.encode:”));
if(this.req.overrideMimeType&&this.encode){
this.req.overrideMimeType(‘text/xml’+(this.encode?’;charset=’+this.encode:”));
} this.req.send; } catch{
this.halt(‘[open]’+e.name+’:’+e.message+’n**检查是或不是为跨域访谈。’卡塔尔国;
} }; oAjax.prototype.callback=function{ //alert; }; //abort
oAjax.prototype.abort=function; }; oAjax.prototype.halt=function{
this.error&&alert; }; //gb2312toutf8 oAjax.gb2utf8=function{
varglbEncode=[]; gb2utf8_data=data;
execScript(“gb2utf8_data=MidB”,”VBScript”);
vart=escape.replace.replace/g,”%$2%$1″).replace/g,”@$1$2″); t=t.split;
vari=0,j=t.length,k; while{ k=t[i].substring; if{ gb2utf8_char=eval;
execScript(“gb2utf8_char=Chr”,”VBScript”);
glbEncode[k]=escape.substring; }
t[i]=glbEncode[k]+t[i].substring; }
gb2utf8_data=gb2utf8_char=null; returnunescape; } */宗旨代码复制代码 代码如下:varb=xmlhttp.responseText;
varobj=eval; document.getElementById.innerHTML=obj.a;
document.getElementById.innerHTML=obj.b;
document.getElementById.innerHTML=obj.b;

发表评论

电子邮件地址不会被公开。 必填项已用*标注