HasClass does not display in IE

I use the Marketpress plugin in Wordpress, which has been configured to add multiple items to the cart with one click. My problem is this page

The add to cart button appears in Chrome just fine, but it doesn't appear in IE. I believe the problem in this area

if($(".mp_button_addcart").length){ if($('body').hasClass('page-id-1563') || $('body').hasClass('page-id-391')){ console.log('show'); $('.page-bkp-frame').last().append('<input style="display:block" class="total_adddcart" type="button" name="addcart" value="Add To Cart >>" onclick="javascript:addcart_all();" >'); }else{ $('.mp_button_addcart').show(); $('.chk-addcart').remove(); $('.mp_buy_form').attr('style', ''); } } 

Any help is greatly appreciated.

+4
source share
3 answers

console.log (); in many cases will kill jQuery in IE. try to comment on this. Could do the trick. You can test the theory by pressing F12 and reloading it. If it works, then the problem is with console.log.

+2
source

If this is the case, you can try this approach. Not the best approach though ..

 var $body = $('body'); var classNames = $body.prop('class'); if( classNames.indexOf('page-id-1563') > -1 || classNames.indexOf('page-id-391') > -1){ // Your code } 
0
source

Edit

 if(jQuery(this).find('input[type="checkbox"]').attr('checked') == 'checked'){ 

to

 if (jQuery(this).find('input[type="checkbox"]').prop('checked')) { 
0
source

All Articles