js动态创建iframe,无法加载src所指定的页面,请问是什么原因?
var div = document.getElementById("dialog1");
var iframe = document.createElement("iframe");
//iframe.setAttribute("src","test.html");
iframe.src = 'test.html';
iframe.style.width = "100%";
iframe.style.height = "100%";
div.appendChild(iframe);
$("#dialog1").dialog('open');
var div = document.getElementById("dialog1");
var iframe = document.createElement("iframe");
//iframe.setAttribute("src","test.html");
iframe.src = 'test.html';
iframe.style.width = "100%";
iframe.style.height = "100%";
div.appendChild(iframe);
$("#dialog1").dialog('open');
document.body.appendChild(div)
无法加载 具体是什么意思?你调试过了没? 确认这个src无法加载吗?如果页面直接写iframe 能否加载这个src?
这个能加载吗