真麻烦!FF2.0测试通过,没任何警告!L@_@Kfunction sureok()

    return window.confirm("你确定要删除吗?");
}window.alert(sureok());

解决方案 »

  1.   

    不加window也可以!
    L@_@K
    <!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>
        <title>are you sure?</title>
        <meta name="generator" content="editplus" />
        <meta name="author" content="Gao YiXiang" />
        <meta name="email" content="[email protected]" />
        <meta name="keywords" content="javascript dhtml dom" />
        <meta name="description" content="I love web development." />
    </head>
    <body>
        <script type="text/javascript">
        <!--
    function sureok()

        return confirm("你确定要删除吗?");
    }alert(sureok());
        //-->
        </script>
    </body>
    </html>
      

  2.   

    楼上的兄弟,不行啊,还是错误return window.confirm("你确定要删除吗?");
      ↑return 处错误
      

  3.   

    没有错误(in FF-2.0 IE-6)用Firebug探测都没有错误!!!
      

  4.   

    没调试 但是肯定没错
    可能你错的不是这个地方 呵呵
    js代码是比较麻烦,没有好的ide 写的时候就需要足够的细心了 尽量把代码写聚合 提高代码重用率
      

  5.   

    呵呵,俺2楼滴代码在IE6sp1-chs和FF2-chs下测试没有任何错误!如果lz说有错,请把全部html代码和所用浏览器版本贴出来!否则没时间猜谜语,哈