无法将google.com作为src添加到IFrame [英] can't add google.com as src to an IFrame

查看:100
本文介绍了无法将google.com作为src添加到IFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

如何在iframe中显示google.com?


为什么有些网站无法作为源添加到我的iframe中



我有这样的代码:

 <!DOCTYPE html PUBLIC -  // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD /xhtml1-transitional.dtd\"> 
< html xmlns =http://www.w3.org/1999/xhtml>
< head>
< script>
函数changeIframe(newLocation){
document.getElementById(myIframe)。src = newLocation;
}
< / script>
< / head>
< body onload =changeIframe('http://www.example.com')>
< div style =width:650px; float:auto; border:1px dotted #cccccc;>