是这样的,你可以将输出结果写入到一个层里面
div.innerHTML=~~~来显示

解决方案 »

  1.   


    [个人意见,仅供参考] 单击按钮去调用aa()函数的时候,document对象已经完全载入并解析完毕了,
    这是再使用document.write就相当于修改document对象的内容(也就是整个页面的内容)
    所以,整个页面的内容就被清除了
    '----------------------------------------
    '个人签名,与本贴无关。
    '瘦猴网络(www.sohoiii.com)
    '----------------------------------------
      

  2.   

    同意楼上的,应该是因为body还未完全加载之前,document.write就会直接写入,但当整个页面加载完毕,也就是body加载完了,document.write就是改写整个body里的内容,应该是这样吧。
      

  3.   

    好好看手册!!!write Method
    Writes one or more HTML expressions to a document in the specified window. Syntax
    document.write(sText)Res
    You should not use the write or writeln methods on the current document after the document has finished loading unless you first call the open method, which clears the current document's window and erases all variables.