select链接同时在两个 框架中打开两个不同的链接

cctvw0m1 2010-06-22 05:10:43
  <select onchange="iframe_banner1.location.href=this.value" name="select"> 
<option value="http://www.sina.com" selected="selected">新浪</option>
<option value="http://cctv.com">cctv|2345</option>
<option value="http://www.qq.com">QQ</option>
</select >



希望框架iframe1打开cctv.com

同时框架iframe2打开2345.com


请问添加什么代码才能让2345.com在iframe2打开
...全文
58 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cctvw0m1 2010-06-22
  • 打赏
  • 举报
回复
select链接同时在两个 框架中打开两个不同的链接 楼上正解
shenzhenNBA 2010-06-22
  • 打赏
  • 举报
回复
抢分,呵呵....
看看这个....

<html>
<head><title>TEST</title></head>
<style type="text/css">
*{font-family:verdana; font-size:12px; margin:0; padding:0}
</style>
<script language="javascript">
function openLink(){
var v=document.getElementById("select1").value.split("|");
var iLink,iTxt;
for(var i=0;i<v.length;i++){
iLink=document.createElement("a");
iTxt=document.createTextNode("iLink"+i)
iLink.appendChild(iTxt);
iLink.href=v[i];
try{
iLink.target="openWin"+i;
}catch(e){
iLink.target="_blank";
}
iLink.style.display="none";
document.getElementById("doc").appendChild(iLink);
iLink.click();
iLink=null;
}
}
</script>
<body id="doc">
<select onchange="javascript:openLink();" id="select1" name="select1">
<option value="http://www.sina.com" selected="selected">新浪</option>
<option value="http://www.cctv.com|http://www.2345.com">cctv|2345</option>
<option value="http://www.qq.com">QQ</option>
</select >
打开连接<br>
window 0
<hr size="1" color="#CCCCCC">
<iframe name="openWin0" id="openWin0" width="100%" height="40%" frameborder="0"></iframe>
<br>
window 1
<hr size="1" color="#CCCCCC">
<iframe name="openWin1" id="openWin1" width="100%" height="40%" frameborder="0"></iframe>
</body>
</html>
cctvw0m1 2010-06-22
  • 打赏
  • 举报
回复
谁知道????????????
孟子E章 2010-06-22
  • 打赏
  • 举报
回复
<select onchange="window.open('xxx','iframe2');iframe_banner1.location.href=this.value" name="select">

or

<select onchange="iframe_banner1.location.href=this.value;iframe_banner2.location.href='http://wwww.1213.com'" name="select">

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧