開啟視窗並寫入影像檔
document.write()
document.open()
document.close()
可開啟視窗並寫入影像檔
程式碼如下:
<script>
function Event1(){
//create a blank window
var w1 = window.open("", "mywin");
//open that to write
w1.document.open();
w1.document.write("<img src='http://spiderdaily.wayi.com.tw/upload/images/Meone/2013/7M/0717/mi1020717_1_00_2.gif'>");
w1.document.close();
}
</script>
<input type="button" value="Press to start" onclick="Event1()">