jquery IE8/9/10 Bind to click not working

前端 未结 3 615
無奈伤痛
無奈伤痛 2021-01-27 11:29

Facing an issue with IE and jquery. The code is working in all other browsers but breaks when used in IE. Fairly simple implementation. But I am javascript novice.



        
3条回答
  •  天命终不由人
    2021-01-27 11:52

    Depending on your jQuery version, your issue is likely the .bind() which should be performed with .on() like this

    HTML

    jQuery

    $(document).ready(function () {
        $(".class").on("click", function (event) {
            console.log('We clicked!');
            poll(); // <-- wtf does this do exactly??
        });
    });
    

提交回复
热议问题