js点击跳转到指定页面并打开一个链接链接,显示在指定页面里面的iframe里
将要在iframe打开的url地址传递到目标页面,url地址需要encodeURIComponent编码一下,要不页面由参数可能会丢失
或者动态设置也行,如下面这种
<a href="#" onclick="this.href='target.html?'+encodeURIComponent(this.innerHTML)">http://bbs.csdn.net</a>
target.html
var url=location.search.substring(1);
alert(url)
if(url)document.write('<iframe src="'+url+'"></iframe>')//如果存在iframe容器,这些代码放在iframe下,改为if(url)document.getElementById('iframe的id').src=url
http://m.jb51.net/web/23407.html
iframe其实是个链接,你可以自已iframe那个地址啊!