Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/397.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未实施IE8:解决此问题?_Javascript_Internet Explorer 8 - Fatal编程技术网

Javascript 未实施IE8:解决此问题?

Javascript 未实施IE8:解决此问题?,javascript,internet-explorer-8,Javascript,Internet Explorer 8,我在IE8的这一行中得到一个错误,带有未实现的错误。如何在其他浏览器上执行这一行,并让IE8忽略这一点 window.onbeforeunload = function () { 这很奇怪。这里面没有任何东西会导致错误。此脚本加载在正文的末尾,因此所有html都存在,将此代码移到文件的底部即可解决此问题。为什么? window.onbeforeunload = function () { var txtbox = $('.box textarea').eq(0); var tx

我在IE8的这一行中得到一个错误,带有未实现的错误。如何在其他浏览器上执行这一行,并让IE8忽略这一点

window.onbeforeunload = function () {
这很奇怪。这里面没有任何东西会导致错误。此脚本加载在正文的末尾,因此所有html都存在,将此代码移到文件的底部即可解决此问题。为什么?

window.onbeforeunload = function () {
    var txtbox = $('.box textarea').eq(0);
    var txt = txtbox.val();
    var btn = $('.box button').eq(0).html();
    if (btn == "Thank You")
        return;
    if (btn == "Sending")
        return "not complete";
    if (txt != '') {
        return "blah"
    }
    return;
}

使用条件注释,这意味着放置一个

<!--[if !(IE 8)]>
<![endif]-->
环绕