Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.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 浏览器警报弹出窗口未显示在IE中的当前窗口上_Javascript_Jquery_Html - Fatal编程技术网

Javascript 浏览器警报弹出窗口未显示在IE中的当前窗口上

Javascript 浏览器警报弹出窗口未显示在IE中的当前窗口上,javascript,jquery,html,Javascript,Jquery,Html,警报弹出窗口未显示在其他浏览器上显示的当前窗口上(相同的警报弹出窗口)。 这个bug只出现在IE上,在chrome和Mozilla上运行良好 if (iNum > 99) { document.getElementById(id).value = ''; alert('value not be greater than'); //this alert popup open in another broswer in IE

警报弹出窗口未显示在其他浏览器上显示的当前窗口上(相同的警报弹出窗口)。 这个bug只出现在IE上,在chrome和Mozilla上运行良好

 if (iNum > 99) {
            document.getElementById(id).value = '';
            alert('value not be greater than'); //this alert popup open in another broswer in IE
            return false;
        }
  • 确保您的控制台没有显示任何错误,如果有错误,请更正
  • 确保没有在IE上禁用浏览器提示
  • 尝试使用
    window.alert()
    ,可能(尽管不太可能)另一个
    alert()
    与window的冲突
  • 如果您有控制台支持,请尝试
    console.log(警报)并查看它所显示的内容。应该是这样的:

    function alert() {
        [native code]
    }
    

  • *您可以尝试通过设置->兼容性视图设置打开兼容性视图,并在其中添加您的网站url

    *或者,您可以打开兼容性视图,将此meta标记放在页面的head标记中,如下所示

    <head>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
    <head>
    
    
    

    您可以参考了解兼容性模式。

    您正在使用的IE版本是什么?IE版本11.0@SachinthaNayanajithDid您尝试添加兼容性视图-@SiddharthVyas?@SachinthaNayanajith抱歉,我不明白,请您进一步了解我添加了答案。你可以试试@悉达多