日期:2014-05-17  浏览次数:20717 次

iframe 跨域问题
我的项目里面有个页面A.html

在A页面中有个<iframe>现在我的需求是要在A中跳转iframe地址,到其它的网站,不需要访问iframe里面的内容,只需让IRAME能连接到其它网站的页面即可,该怎么做?

------解决方案--------------------
<a href="a.html" target="myframe">a</a>     
<a href="b.html" target="myframe">b</a>     
<a href="c.html" target="myframe">c</a>     
<iframe src="a.html" id="myframe" frameborder="0" target="_self"></iframe>    
------解决方案--------------------
设置 iframe src 就可以了
------解决方案--------------------
引用:
<a href="a.html" target="myframe">a</a>     
<a href="b.html" target="myframe">b</a>     
<a href="c.html" target="myframe">c</a>     
<iframe src="a.html" id="myframe" frameborder="0" target="_se……


------解决方案--------------------
引用:
<a href="a.html" target="myframe">a</a>     
<a href="b.html" target="myframe">b</a>     
<a href="c.html" target="myframe">c</a>     
<iframe src="a.html" id="myframe" frameborder="0" target="_se……

document.getElementById("myframe").src="http://www.baidu.com/?from=www.google.cn"