IE11下javascript脚本不执行的怎么办

时间:2026-02-13 23:24:50

1、一种解决方案是在你网站的web.config中配置IE的兼容模式:

<system.webServer>

    <httpProtocol>

        <customHeaders>

            <clear/>

            <add name="X-UA-Compatible" value="IE=edge"/>

        </customHeaders>

    </httpProtocol>

<system.webServer>

2、还有一种方式是在页面中添加以下meta:

<meta http-equiv="X-UA-Compatible" content="IE=edge"/>

3、然后检查一下Jquery代码是否正确,确保事件绑定操作在页面加载的时候正确执行,jquery绑定点击事件代码如下:

$(function(){    $("#id1").click(function(){        //...    });});

© 2026 一点资料
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com