window.open("help.htm");---
//help.htm 用iframe
<iframe src="a.htm" onerror="src=other.htm" ></iframe>

解决方案 »

  1.   

    要检测链接的存在又不想把链接的文件全部加载过来..XMLHTTP.Open "Head",url,false可以实现。。相关代码:function checkStatus(url)
    {
    XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP")
    XMLHTTP.open("HEAD",url,false)
    XMLHTTP.send()
    return XMLHTTP.status==200
    }
    alert(checkStatus("http://dotnet.aspx.cc/"))
    http://community.csdn.net/Expert/topic/3425/3425220.xml?temp=.2533991
      

  2.   

    function checkStatus(url)
    {
    XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP")
    XMLHTTP.open("HEAD",url,false)
    XMLHTTP.send()
    return XMLHTTP.status==200
    }
    if(!checkStatus("http://dotnet.aspx.cc/"))
    window.open("http://community.csdn.net/Expert/topic/3453/3453310.xml?temp=4.313296E-02")
      

  3.   

    你可以用错误处理,如果window.open("a.htm");成功就打开。不成功他执行  catch{}指向你的缺省页
    try
    {
       window.open("a.htm");
    }
    catch
    {
      window.open("b.htm");
    }
      

  4.   

    要判断文件是否存在,用fso好了~:),不过这也是一个办法。