下面这个JAVASCRIPT怎么写成PROTOTYPE形式呢?用到prototype.jsfunction sekhsearch(key){
var currentURL = window.location;
var live_site = currentURL.protocol+'//'+currentURL.host+sfolder;
var lsXmlHttp;
try {
lsXmlHttp=new XMLHttpRequest();
} catch (e) {
try { lsXmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try { lsXmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
return false;
}
}
}
lsXmlHttp.onreadystatechange=function() {
var response;
if(lsXmlHttp.readyState==4){
setTimeout(function(){
response = lsXmlHttp.responseText;
var div = document.getElementById("search_engine_box");
div.innerHTML=response;
div.style.display="block";
},500);
}
}
lsXmlHttp.open("GET",live_site+"/plugins/content/sekh/ajax.php?key="+key,true);
lsXmlHttp.send(null);
}
var currentURL = window.location;
var live_site = currentURL.protocol+'//'+currentURL.host+sfolder;
var lsXmlHttp;
try {
lsXmlHttp=new XMLHttpRequest();
} catch (e) {
try { lsXmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try { lsXmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
return false;
}
}
}
lsXmlHttp.onreadystatechange=function() {
var response;
if(lsXmlHttp.readyState==4){
setTimeout(function(){
response = lsXmlHttp.responseText;
var div = document.getElementById("search_engine_box");
div.innerHTML=response;
div.style.display="block";
},500);
}
}
lsXmlHttp.open("GET",live_site+"/plugins/content/sekh/ajax.php?key="+key,true);
lsXmlHttp.send(null);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货