jQuery Ajax is not triggered in IE 6, 7, 8 -


my jquery ajax call working fine in chrome , firefox, when test in ie 6, 7, 8 not working (the ajax call not triggered, no request send server). here code:

$.ajax({                 url: myurl,                 type: 'get',                 async: false,                 cache: false,                 contenttype: 'application/text', //i tried use json                 datatype: 'text', //i tried use json                 data: {car_id: car_id, customer_id: customer_id},                 success: function(data) {                     //some code here deal 'data'                 },                 error: function(xhr, status, error) {                     //some code here                 }     }); 

i have tried both 'text' , 'json' data type, code not working in ie, no request send server... how rid of ie problem??

---------------------edit----------------------------

myurl='/cars/reserved_cars/' 

i developing rails 3 application, trigger means access myurl call carscontroller's reserved_cars() function.

fundamentally, code quoted works (if remove contenttype, said you'd tried): http://jsbin.com/ireko3

some thoughts:

  1. is myurl on same server? if not, you're running same origin policy, using server supports cors, supported transparently firefox , chrome not (at all) ie6 or ie7.
    => that's not it, edited question shows url on same server.

  2. is other end really expecting text or json? expecting multi-part form data, , wouldn't specify contenttype @ all.
    => that's not it, you've said below tried without contenttype.

  3. are sure code being run @ all? suspect you're not getting $.ajax(...); call. ie reporting syntax errors. there aren't in quoted code, if have above it... 1 thing fits profile (chrome , firefox work, ie6 , ie7 don't) if have dangling comma somewhere in object literal, details: a literal improvement
    => sigh , that's not it, you've said doesn't work in ie8 either, , ie8 doesn't have problem.

you've said below link above doesn't work in ie6. should work, , me, tells me there's going on in setup.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -