我的網頁打開app.html first.After點擊登錄後,我需要打開index.html,我打開iframe和我動態創建iframe在javascript.so打開我的框架即時追加到document.body.But其追加到app.html.But的身體,我需要在新頁面中打開打開iframe src到新頁面
var el = document.createElement("iframe");
el.setAttribute('id', 'ifrm');
el.setAttribute('name', 'ifrm');
el.setAttribute('src', '/index/index.html');
el.setAttribute('width', '100%');
el.setAttribute('height', '100%');
el.setAttribute('scrolling', 'no');
document.body.appendChild(el);
你的問題是有點混亂往裏面...你是否試圖打開index.html N ADDITION到原始app.html,作爲一個彈出窗口,作爲一個新的選項卡,或在SAME窗口/ tab/frame - 換句話說要取代它?請提供更多信息,我們可以幫助您更好。 – 2014-05-08 14:08:44