jquery IE8/9/10 Bind to click not working

前端 未结 3 577
無奈伤痛
無奈伤痛 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条回答
  •  -上瘾入骨i
    2021-01-27 11:57

    The problem with this javascript is that it was attempting to alter a page which is being built with some ajax framework. Its the MicroStrategy BI application. if I put a break point after document ready there is no content renderd on the page.

    The solutions on this page helped me get here which should cover if/ff/chrome

    jQuery( document ).ready(function() {
        setTimeout(test, 1000);
          jQuery(".controlApply").on("click", function (event) {
              pollVisibility();
          });
    });
    
    
    
    function test(){
           jQuery('.mstrTransform').on('click', '.controlApply', function(){
               pollVisibility();
           });
    }
    

提交回复
热议问题