var iframe = document.createElement('iframe');
iframe.id = 'test';
iframe.name = 'test';
iframe.src = 'about:blank';
iframe.addEventListener('load', function () {
var iframeDoc = iframe.contentDocument;
var iframeBody = iframeDoc.body;
console.log(document === window.top.document);
var script = document.createElement('script');
script.src = 'http://example.com/test.js';
script.type = 'text/javascript';
iframeBody.appendChild(script);
}, false);
document.body.appendChild(iframe);

在iframe中使用document.createElement
而非使用iframe.contentDocument.createElement
的潜在问题是什么?