JQuery $ .post () function does not work in IE if developer tools are open

The jQuery $ .post () function does not work in IE. I tried to open the developer tools to find out if I get a console error, but by a miracle the function started to work.

This is the standard function $ .post ()

$.post('child_cb.php?type=check', { value: $(this).val() }, function(data) { console.log(data); if (data == 'true') { $(".check_case").removeClass('bad').addClass('good'); } else if (data == 'false') { $(".check_case").removeClass('good').addClass('bad'); } }); 

I see no reason why this will not work.

+4
source share
2 answers

delete / comment out console.log(data) , IE will not be able to handle this, it should work fine after removal. Recently, this problem has been.

+23
source

You should get used to using this for debugging so as not to forget console.log:

 if(!('console' in window) || ( ('console' in window) && !('log' in console) )){ window.console = { log:function(e){ alert("You are using console log without the console!") } } } 

you can remove the warning, but this is normal if you want to be notified that you have forgotten something. :)

+1
source

All Articles