lz可以试试定义一个div,让后把想要展示的html代码写到div.innerHTML中应该可以实现.

解决方案 »

  1.   


    网络都已经断了, 用AJAX取返回码 这个应该比较简单点。对于LZ 的1  网络都断的, 也不能访问服务器了,第一当然是实现不了的。
    对于第二点, 就是比较多工作量,要在每个页面都要用JS 在客户端弹出。
      

  2.   

    这样应该可以,也可以把出错HTML代码放到脚本里.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    window.onload = function(){
    var win = window.open('about:blank', 'error', '');
    var html = document.getElementById("divError").innerHTML;
    win.document.write(html);
    win.document.close();
    };
    </script>
    </head><body>
    <div id="divError" style="display:none">
    <font color="red"><strong>出错了!</strong></font>
    </div>
    </body>
    </html>
      

  3.   


    function fetchStatus(address) {
     var client = new XMLHttpRequest();
     client.onreadystatechange = function() {
      // in case of network errors this might not give reliable results
      if(this.readyState == 4)
       returnStatus(this.status);
     }
     client.open("HEAD", address);
     client.send();
    }
    http://www.w3.org/TR/XMLHttpRequest/
      

  4.   

    断线检测已经实现了。
    目前的情况是,客户不同意用<div>显示信息的方法。
    必须用打开一个新IE窗口的方式显示信息。
      

  5.   

    TO luojihaidao 
    》对于第二点, 就是比较多工作量,要在每个页面都要用JS 在客户端弹出。 
    怎么实现,给个思路。
      

  6.   

    已经找到办法了,但我需要的是
    出来的一定是模式窗口。<html><head><SCRIPT LANGUAGE="javascript">function openwin(){OpenWindow=window.open("", "newwin", "height=250,width=250,alwaysRaised=yes,toolbar=no,scrollbars="+scroll+",menubar=no");OpenWindow.document.write("<TITLE>例子</TITLE>")OpenWindow.document.write("<BODY BGCOLOR=#ffffff>")OpenWindow.document.write("<h1>Hello!</h1>")OpenWindow.document.write("New window opened!")OpenWindow.document.write("</BODY>")OpenWindow.document.write("</HTML>")OpenWindow.document.close()}</SCRIPT></head><body><a href="#" onclick="openwin()">打一个窗口</a><input type="button" onclick="openwin()" value="打窗口"></body></html>