iframe中插入代码并执行
摘要:最近有需求通过iframe插入代码。有蛮多方法,如下:1 var iframe = document.getElementById('previewUrl');2 iframe.src = 'about:blank';3 iframe.contentWindow.document.body.innerHTML+="12312"4 iframe.contentWindow.document.close();试了下,如下代码也可以:iframe.contentWindow.document.getElementsByTagName('ht
阅读全文
posted @ 2013-08-01 20:49