因此,我知道如何在google中創建一個彈出窗口,並且我知道如何在彈出窗口中編寫,但是如何在彈出窗口中添加其他HTML標記?如何在彈出窗口中編輯html?
我有的HTML代碼如下。
<html>
<head>
<script>
function openWin()
{
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>NEW WINDOW<p>");
}
</script>
</head>
<body>
<button onmousedown='openWin();'>Hello</button>
</body>
</html>
正如你所看到的,在執行document.write功能,我有兩個<p>
標籤,我也可以用<button>
標籤,但我不能用<script>
標籤,沒有人知道爲什麼,或者如果它有可能嗎?
http://stackoverflow.com/questions/10946800/how-to-add-script-files-in-child-window-using-javascript –
我覺得這是我們缺少關鍵的是_why_你試圖將腳本標籤寫入彈出窗口?我很難想象需要哪種場景...... –