Note that there are some explanatory texts on larger screens.

plurals
  1. POIE8 not refreshing values with javascript
    primarykey
    data
    text
    <p>I am using javascirpt and ajax for adding/updating/dropping items from a checkout basket,<br> Everything looks and works good on all the browsers except IE8</p> <p>On IE8 when i add/update/drop an item to the basket, i need to refresh the window for the basket to pick up the value change, is is not doing it dynamically as it is for the other browsers. It works fine on IE9 and IE10</p> <p>here is the function I am using for the basket </p> <pre><code>$('#add_to_basket').click(function(e) { e.preventDefault(); var product_id = $('#add_to_basket').attr('rel'); var quentity = $('select[name="quantity"]').val(); var size = $('select[name="size"]').val(); var colour = $('select[name="colour"]').val(); var error = 0; if (quentity == '') { $('select[name="quantity"]').siblings('.selectBox-dropdown').eq(0).addClass('error'); error = 1; } if (size == '') { $('select[name="size"]').siblings('.selectBox-dropdown').eq(1).addClass('error'); error = 1; } if (colour == '') { $('select[name="colour"]').siblings('.selectBox-dropdown').eq(2).addClass('error'); error = 1; } if (error === 0) { $.ajax({ url: site_url + '/basket/add', type: 'POST', data: { quantity: quentity, size: size, colour: colour, product_id: product_id }, dataType: "json", success: function(msg) { if (msg.success == true) { $('#header_basket_list').html(msg.data); $('#basket_count').text(msg.basket_count); $('#proceed_to_checkout').show(); } } }); $("#dialog").dialog({ modal: true, show: { effect: 'drop', direction: "up" }, hide: { effect: 'drop', direction: "up" }, open: function(){ setTimeout(function(event,ui){ $('#dialog').dialog("close"); }, 2000); } }); // window.setTimeout($("#dialog").dialog("close"),200); } }); $('.basket_drop').on('click', '.delete_btn', function() { var selector = $(this); $.ajax({ url: site_url + '/basket/delete_item', type: 'POST', data: { key: $(selector).attr('rel') }, dataType: "json", success: function(msg) { if (msg.success == true) { $(selector).parent().remove(); var basket_count = parseInt($('#basket_count').text()) - 1; $('#basket_count').text(basket_count); if (basket_count == 0) { $('#proceed_to_checkout').hide(); } } } }); }); $('.basket_drop').on('click', '.quantity_box .arrows', function() { var selector = $(this); var input = $(selector).parent().children('input'); var key = $(selector).parents('.basket_product').children('.delete_btn').attr('rel'); var basket_count; if (input.length == 0) return; input = input.eq(0); if ($(selector).hasClass('increase')) { basket_count = input.val(parseInt(input.val()) + 1); } else { basket_count = input.val(parseInt(input.val()) &gt; 1 ? parseInt(input.val()) - 1 : 1); } $.ajax({ url: site_url + '/basket/count_item', type: 'POST', data: { key: key, basket_count: basket_count.val() }, dataType: "json", success: function(msg) { if (msg.success == true) { var price = $(selector).parents('.basket_product_info').children('.price').attr('rel'); var new_price = (price * parseFloat(basket_count.val())); $(selector).parents('.basket_product_info').children('.price').children('spam').html(new_price.toFixed(2)); } } }); }); $('.basket_drop').on('keyup', '.quantity_box input[name="basket_count"]', function() { var selector = $(this); var input = $(selector).parent().children('input'); var key = $(selector).parents('.basket_product').children('.delete_btn').attr('rel'); var basket_count = $(selector).val(); $.ajax({ url: site_url + '/basket/count_item', type: 'POST', data: { key: key, basket_count: basket_count }, dataType: "json", success: function(msg) { if (msg.success == true) { var price = $(selector).parents('.basket_product_info').children('.price').attr('rel'); var new_price = (price * parseFloat(basket_count)); $(selector).parents('.basket_product_info').children('.price').children('spam').html(new_price.toFixed(2)); } } }); }); </code></pre> <p>Any help is much appreciated,</p> <p>Thanks a lot,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload