<script language="javascript">
function getURL(url)
{
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.open("GET",url,false);
    xmlhttp.send();
    if (xmlhttp.readyState==4)
      alert((xmlhttp.Status==200)?"存在":"不存在");
}
//user like this:
getURL("http://www3.bj.cmbchina.com/rate/ratescrollnew.asp");
//你可以先用这个方法判断一下这个链接的正确性再加载它
</script>

解决方案 »

  1.   

    楼上大侠,那我该怎么加载呢.我照你的方法试了一下..会跳出不存在.
    能不能帮我解决一下;就是有错误的时候,不要跳出不存在.然后iframe里的内容就是显示空白的.
    谢谢........
      

  2.   

    <body bgcolor=green>
    <IFRAME name=meizz scrolling="no"  marginwidth=0  marginheight=0  frameborder=0  vspace=0  hspace=0  width=160  height=120></IFrame><script language="javascript">
    function getURL(url)
    {
        var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        xmlhttp.open("GET",url,false);
        xmlhttp.send(null);
        if (xmlhttp.readyState==4 && xmlhttp.Status==200)
        {
          window.open(url, "meizz");
        }
    }
    getURL("http://www3.bj.cmbchina.com/rate/ratescrollnew.asp");
    </script>
      

  3.   

    meizz大侠,照你的方法试了一下,结果是可以的,但是运行的时候会跳出一个对话框,说是超出范围,运行的话可能有危险..有没有办法做到不跳出这个对话框?