0

Following call is failing in chrome and IE but works fine in firefox

        var count = 0;
        var timerId=setInterval(function(){
            jQuery.ajax({
            url :"test.htm",
            type : "POST",
            data : sendData,
            success:function(data){
                jQuery(".divClass").remove();
                jQuery("#myId").append(data).addClass("newClass");
                clearInterval(timerId);
                },
                error :function(data){
                    if(count == 20){
                        jQuery(".divClass").remove();
                        jQuery("#myId").append(data).addClass("newClass");
                        clearInterval(timerId);
                    }
                    count++;
                }
        });
           },1000);

In debugging control is lost at jQuery(".divClass").remove(); in success method. All that remains is the header of the modal box. After all of this call when I re run the append and remove calls from console they seem to work fine. Problem is happening only in the success method of ajax call.

I tried all the answers provided here. Any other suggestion is highly appreciated.

Community
  • 1
  • 1
Aniket Thakur
  • 66,731
  • 38
  • 279
  • 289

0 Answers0