继承人可以使用的非常基本的Javascript函数。函数参数是您要将iframe附加到的元素,以及它要指向的位置。
的HTML
<a href="#" onclick="setIframe(this,'http://www.stackoverflow.co.uk')" >Set the Iframe up</a>
的Javascript
function setIframe(element,location){ var theIframe = document.createElement("iframe"); theIframe.src = location; element.appendChild(theIframe);}


