请问这段JS哪里引用了<base>标签里href的值,怎么在JS里直接添加<base>的值了从而不在引用呢? 本帖最后由 jsjsrrr 于 2010-11-14 12:19:39 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有看到BASE标签,看得头都有点悬乎了! BASE标签在HTML代码最开始部分...引用的是一个地址..去掉base标签和内容后下拉菜单失效... 用编辑器的“替换”功能,把下面代码里面的“{theforever赵亮}”替换成你BASE URL里的地址,注意,替换的URL末尾不能带/。用{theforever赵亮}这个标签,是因为近来发现很多网站转了CSDN的帖子过去,却把回帖者的名字也都略去了。对于不是信手搜索甩两个URL,而是付出时间去解决问题的回帖者来说,是一种很大程度的不尊重,所以我会在我认为应该加的回复里加一点进来。如果我早在意点这个问题,也不会在搜索引擎里搜索结果少得可怜了。<script>var lastInput;var obj_div_word=document.getElementById("div_word_list");var selectedIndex=-1;function getData(source){var xmlHttp=false;if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();}elseif(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");};if(xmlHttp){xmlHttp.open("GET",source);xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4&&xmlHttp.status==200){var message=xmlHttp.responseText;var rData=eval("new Array("+message+");");if(rData.length>1){var callBack=Suggest_apply(frameElement,"Ajax",rData,new Array(""));eval(callBack);}else{document.getElementById("div_word_list").className="div_word_hidden";document.getElementById("div_word_list").innerHTML="";};selectedIndex=-1;}};xmlHttp.send(null);}};function connectSoSuggest(keyEvnet){var input=document.getElementById("wd");if(input.value){if(input.value){obj_div_word.style.display="";lastInput=escape(input.value);getData("{theforever赵亮}/key?wd="+escape(input.value));}}else{document.getElementById("div_word_list").className="div_word_hidden";document.getElementById("div_word_list").innerHTML="";}};function Suggest_apply(unusedVariable,searchWord,results,unusedArray){document.getElementById("div_word_list").className="div_word_show";var data="";for(var i=0;i<results.length;i+=2){data+="<div onmouseout=\"this.className=''\" onmouseover=\"this.className='div_word_selected'\"><span style=\"display:none;\">"+results[i]+"</span><a href=\"{theforever赵亮}/search?wd="+results[i]+"&cf=search\"><span>"+results[i+1]+"</span>"+results[i]+"</a></div>";};data+="<div ><span style=\"display:none;\"></span><a href=\"javascript:;\" onclick=\"document.getElementById('div_word_list').className = 'div_word_hidden';document.getElementById('div_word_list').innerHTML= '';\"><span>关闭</span>×</a></div>";document.getElementById("div_word_list").innerHTML=data;};function checkKeyCode(event){var keyCode=event.keyCode;if(keyCode==40||keyCode==38){var isUp=false;if(keyCode==40)isUp=true;chageSelection(isUp);}else if(keyCode==13){form1.submit();}else{connectSoSuggest(event);}};function chageSelection(isUp){var objouter=document.getElementById("div_word_list");var obj_wd=document.getElementById("wd");if(objouter.className=='div_word_hidden'){objouter.style.display='none';}else{objouter.className="div_word_show";if(isUp){selectedIndex=selectedIndex+1;}else{selectedIndex=selectedIndex-1;}};var maxIndex=objouter.childNodes.length-1;if(selectedIndex<0){selectedIndex=maxIndex};if(selectedIndex>maxIndex){selectedIndex=0};for(intTmp=0;intTmp<=maxIndex;intTmp++){if(intTmp==selectedIndex){objouter.childNodes[intTmp].className="div_word_selected";var nowDiv=objouter.childNodes[intTmp].innerHTM;if(nowDiv!='undefined')obj_wd.value=objouter.childNodes[intTmp].childNodes[0].innerHTML;}else{objouter.childNodes[intTmp].className="";}}}var cid;cid=getCookies("pps_client_id");getStat(cid);function getCookies(a){var b=document.cookie.match(new RegExp("(^| )"+a+"=([^;]*)(;|$)"));if(b!=null)return unescape(b[2]);return''}function getStat(a){try{var b=new Image(1,1);var c=escape(document.referrer);var d=escape(location.href);b.src="http://stat.ppstream.com/write_so.php?wd=&last=&id="+a+"&cli=3&ref="+c+"&url="+d;b.onload=function(){return}}catch(e){}}function soStat(){try{var a=document.getElementById("wd").value;var b=getCookies("last_wd");var c=getCookies("pps_client_id");var d=new Image(1,1);var f=escape(document.referrer);var g=escape(location.href);d.src="http://stat.ppstream.com/write_so.php?id="+c+"&cli=3&ref="+f+"&url="+g+"&key="+a+"&last="+b;d.onload=function(){return}}catch(e){}}document.onmouseup = function() { document.getElementById("div_word_list").style.display = "none";} </script> 如何添加复制全文的代码? js关闭按钮放右边 传参数的问题 js 实现图片轮换效果 求JS多选日期控件. 切换选项卡后就不滚动了 在jqgrid中grid作为子表格,能否实现点击+号后,只第一次提交服务器,以后不再提交到服务器端? 求一个最简单的联动下拉菜单实现方法! 请推荐写脚本使用的编辑器? 关于CHECKBOX控制文本框的问题 flv视频地址分析 jQuery slidetoggle方法的问题 show()函数中那个for循环能那样用吗? 在线等
var lastInput;
var obj_div_word=document.getElementById("div_word_list");
var selectedIndex=-1;
function getData(source)
{
var xmlHttp=false;if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();
}
else
if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");};
if(xmlHttp){xmlHttp.open("GET",source);xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4&&xmlHttp.status==200)
{
var message=xmlHttp.responseText;
var rData=eval("new Array("+message+");");
if(rData.length>1)
{var callBack=Suggest_apply(frameElement,"Ajax",rData,new Array(""));
eval(callBack);
}
else{document.getElementById("div_word_list").className="div_word_hidden";document.getElementById("div_word_list").innerHTML="";};
selectedIndex=-1;
}
};
xmlHttp.send(null);
}
};
function connectSoSuggest(keyEvnet)
{
var input=document.getElementById("wd");
if(input.value)
{
if(input.value)
{
obj_div_word.style.display="";lastInput=escape(input.value);getData("{theforever赵亮}/key?wd="+escape(input.value));
}
}else{document.getElementById("div_word_list").className="div_word_hidden";document.getElementById("div_word_list").innerHTML="";}};function Suggest_apply(unusedVariable,searchWord,results,unusedArray){document.getElementById("div_word_list").className="div_word_show";
var data="";
for(var i=0;i<results.length;i+=2){data+="<div onmouseout=\"this.className=''\" onmouseover=\"this.className='div_word_selected'\"><span style=\"display:none;\">"+results[i]+"</span><a href=\"{theforever赵亮}/search?wd="+results[i]+"&cf=search\"><span>"+results[i+1]+"</span>"+results[i]+"</a></div>";};
data+="<div ><span style=\"display:none;\"></span><a href=\"javascript:;\" onclick=\"document.getElementById('div_word_list').className = 'div_word_hidden';document.getElementById('div_word_list').innerHTML= '';\"><span>关闭</span>×</a></div>";document.getElementById("div_word_list").
innerHTML=data;};
function checkKeyCode(event)
{
var keyCode=event.keyCode;if(keyCode==40||keyCode==38)
{
var isUp=false;if(keyCode==40)isUp=true;chageSelection(isUp);
}
else if(keyCode==13){form1.submit();}else{connectSoSuggest(event);
}
};
function chageSelection(isUp)
{
var objouter=document.getElementById("div_word_list");
var obj_wd=document.getElementById("wd");if(objouter.className=='div_word_hidden')
{objouter.style.display='none';
}
else{objouter.className="div_word_show";if(isUp)
{
selectedIndex=selectedIndex+1;}else{selectedIndex=selectedIndex-1;
}
}
;var maxIndex=objouter.childNodes.length-1;if(selectedIndex<0)
{
selectedIndex=maxIndex
};
if(selectedIndex>maxIndex){selectedIndex=0};
for(intTmp=0;intTmp<=maxIndex;intTmp++)
{
if(intTmp==selectedIndex){objouter.childNodes[intTmp].className="div_word_selected";
var nowDiv=objouter.childNodes[intTmp].innerHTM;if(nowDiv!='undefined')obj_wd.value=objouter.childNodes[intTmp].childNodes[0].innerHTML;
}
else{objouter.childNodes[intTmp].className="";
}
}
}
var cid;cid=getCookies("pps_client_id");getStat(cid);
function getCookies(a){var b=document.cookie.match(new RegExp("(^| )"+a+"=([^;]*)(;|$)"));if(b!=null)return unescape(b[2]);return''}
function getStat(a)
{
try
{
var b=new Image(1,1);
var c=escape(document.referrer);
var d=escape(location.href);b.src="http://stat.ppstream.com/write_so.php?wd=&last=&id="+a+"&cli=3&ref="+c+"&url="+d;b.onload=function()
{
return
}
}
catch(e){}
}
function soStat(){try{var a=document.getElementById("wd").value;
var b=getCookies("last_wd");var c=getCookies("pps_client_id");
var d=new Image(1,1);
var f=escape(document.referrer);
var g=escape(location.href);d.src="http://stat.ppstream.com/write_so.php?id="+c+"&cli=3&ref="+f+"&url="+g+"&key="+a+"&last="+b;d.onload=function()
{
return
}
}catch(e)
{
}
}
document.onmouseup = function() { document.getElementById("div_word_list").style.display = "none";}
</script>