62,614
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0044)http://129.25.98.173/portal/filedownload.jsp -->
<HTML><HEAD><TITLE>测试</TITLE>
<BODY >
<a href="test2.html?opentwo=1" target="_blank">打开test2页面同时点击链接</a>
</BODY>
</HTML>
test2:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0044)http://129.25.98.173/portal/filedownload.jsp -->
<HTML><HEAD><TITLE>被打开的页面</TITLE>
<script>
//获取参数
function getURLSearch(isParent){
var strSearch ="";
if(isParent){
strSearch= window.parent.location.search;
}
else{
strSearch= location.search;
}
var reg1 = /=/gi;
var reg2 = /&/gi;
strSearch = strSearch.substr(1, strSearch.length);
strSearch = strSearch.replace(reg1, '":"');
strSearch = strSearch.replace(reg2, '","');
if (strSearch == "")
return null;
else
strSearch = '{"' + strSearch + '"}';
eval("var ArrayUrl=" + strSearch);
return ArrayUrl;
}
//页面onload
function loadPage(){
if(getURLSearch().opentwo=="1"){
document.getElementById("toBaiDu").click();
}
}
</script>
<BODY onload="loadPage()">
<a href="http://www.baidu.com" id="toBaiDu" target="_blank">页面的链接</a>
</BODY>
</HTML>