我用alert(document.documentElement.outerHTML),發現取出的結果隻是頁面內容的前半部分,頁面是html格式的。

解决方案 »

  1.   

    怎麼顯示?那document.documentElement.outerHTML到底有沒有字符數量的限制?我的頁面字符數量大概有3000以上。
      

  2.   

    我用alert(document.documentElement.outerHTML.length)发现显示出来的数字是64654,可是alert(document.documentElement.outerHTML)顯示出來的根本沒那麼多字符,而且我用word统计的结果是字數只有3500多,字元數有66100多(不含空白)
      

  3.   

    <body>
    <textarea id=x style="width:100%;height:50%"></textarea>
    <input type=button onclick="x.value=document.documentElement.outerHTML" value=view>
      

  4.   

    可以全部都顯示出來,可是有些字符被改掉了比如
    http://mklplm.mic.com.cn/Windchill/servlet/WindchillAuthGW/wt.enterprise.URLProcessor/URLTemplateAction?u8&oid=OR%3Awt.workflow.engine.WfProcess
    被改成了
    http://mklplm.mic.com.cn/Windchill/servlet/WindchillAuthGW/wt.enterprise.URLProcessor/URLTemplateAction?u8&amp;oid=OR%3Awt.workflow.engine.WfProcess
    在&后面都被子加上了amp , 这是怎么回事?
      

  5.   

    在页面上点右键,查看源程序时显示的是正确的字符,但显示在textarea里就不一样了.