From Evernote: |
取得html標籤中所有內容Clipped from: http://www.lslnet.com/linux/f/docs1/i04/big5125741.htm |
為了做出另開新視窗,再將父視窗內容複製到子視窗的功能,
之前只會:子視窗名稱.document.body.innerHTML=document.body.innerHTML; 複製body裡面的東西。
在head標籤中的css都沒複製到,後來google到下面這個網址:
http://www.lslnet.com/linux/f/docs1/i04/big5125741.htm網頁中有以下幾個方法:
d ocument.body.parentNode.innerHTML
d ocument.body.parentElement.innerHTML
d ocument.getElementsByTagName("html")[0].innerHTML
d ocument.all.tags("html")[0].innerHTML
d ocument.documentElement.innerHTML
d ocument.body.parentElement.innerHTML
d ocument.getElementsByTagName("html")[0].innerHTML
d ocument.all.tags("html")[0].innerHTML
d ocument.documentElement.innerHTML
沒有留言:
張貼留言