jquery - AJAX success not working in IE9 -
i'm having trouble getting ajax work in ie9 , earlier. works in every other browser including ie10 gives failure response in ie9 , earlier. i've tried every solution i've seen suggested through couple of hours of googling , none have worked.
my form @ kurbo.com/purchase_total.php
here's code that's not working in ie9 or earlier:
$.ajax({ url: "https://my.kurbo.com/api/v1/coupons/"+code, type: 'get', datatype: 'json', async:false, success: function( data ) { obj = data; if (!obj.error){ $('input[name="coupon"]').val(obj.data.code); $('#display-coupon').html(obj.data.description); var date = new date(); date.settime(date.gettime()+(30*24*60*60*1000)); var expires = "; expires="+date.togmtstring(); // document.cookie = 'coupon_shown='+obj.data.code+expires+';'; //(turns off cookie coupon shown) mixpanel.track("physician code applied", { "plan": plan_id, "coupon": obj.data.code, "flag" : flag, "timestamp" : timestamp }); if (obj.data.percent_off!=null){ var discount=obj.data.percent_off*.01*plan_info[plan_id][2]; $('#display-discount').html("- $"+discount.tofixed(2)); var new_total=plan_info[plan_id][2]-discount; $('#total-cost').html("$"+new_total.tofixed(2)); $('input[name=amount]').val(new_total.tofixed(2)); }else{ var discount=obj.data.amount_off; $('#display-discount').html("- $"+discount.tofixed(2)); var new_total=plan_info[plan_id][2]-discount; $('#display-coupon').html(''); $('#total-cost').html("$"+new_total.tofixed(2)); $('input[name=amount]').val(new_total.tofixed(2)); } }else{ $('.coupon-container').prepend('<div class="err_msg">we\'re sorry, physician code not valid.</div>'); //remove existing code if user enters bad 1 $('input[name="coupon"]').val(""); $('#display-coupon').html(""); $('#display-discount').html(""); var new_total=plan_info[plan_id][2]; $('#total-cost').html("$"+new_total.tofixed(2)); $('input[name=amount]').val(new_total.tofixed(2)); window.coupon_code="";//kill code } }, error: function( response ) { $('.coupon-container').prepend('<div class="err_msg">we\'re sorry, physician code not valid.</div>'); //remove existing code if user enters bad 1 $('input[name="coupon"]').val(""); $('#display-coupon').html(""); $('#display-discount').html(""); var new_total=plan_info[plan_id][2]; $('#total-cost').html("$"+new_total.tofixed(2)); $('input[name=amount]').val(new_total.tofixed(2)); window.coupon_code="";//kill code } });