Jquery script not working with IE
<p>I written this script, to add JavaScript functionality to my online shop, the script works fine with Firefox and Chrome, but will not run on ie, and i am not sure why?</p>

<p>i am using <code>jQuery(function( $ ){</code> instead of <code>.ready</code> due to script conflicts, i have tested the script using <code>.ready</code> and it still does not work with ie.</p>

<p>if anyone has an ideas they would be much appreciated.</p>

<pre><code>jQuery(function( $ ){

setInterval(function(){ updatecart();  },8000);

   $('.addtobag').on('click', function(){
       event.preventDefault();
       var postdata = new Object();

       var action = $(this).closest('form').attr('action');

      $(':input',$(this).closest('form')).each(function(evt){

        var L = $(this).attr('name')
        postdata[L] = $(this).val();

      });


       $.post(action, postdata);

       generate('success'); //display banner
        updatecart();   //update cart

            });

    var postdata = new Object();

    postdata['basket'] = phpbasket;



     function updatecart() {

      $.post("/get_cart_details.php", postdata, function (data) {
                      var obj = $.parseJSON(data);
                           $('#qty_js').text(obj.items_qty);
                           $('#amt_js').text(obj.items_value);
                           });

     }



  function generate(type) {
    var n = noty({
        text: 'The item(s) have been added to your basket.',
        type: type,
      dismissQueue: true,
        layout: 'topCenter',
        theme: 'defaultTheme'
    });
    console.log('html: '+n.options.id);

         setTimeout(function() {
      $.noty.closeAll();
    }, 5000);
  }




});
</code></pre>
