weixin_33711647 2014-05-23 15:13 采纳率: 0%
浏览 12

Ajax的jQuery不在IE中发布

I have a problem with post data in jquery

This is my code:

$.ajax({
    cache: false,
    type: "POST",
    url: '<?=base_url();?>cart/add_product1',
    async: false,
    data: {
        job_id: item.job_id,
        quantity: item.quantity,
        price: item.price,
        media_code: item.media_code,
        product_id: item.layout_code,
        product_name: item.product_name,
        reedit_url: item.reedit_url,
        thumb_url: item.thumb_url
    },
    success: function (response, textStatus, jqXHR) {
        console.log('done!');
    },
    error: function (jqXHR, textStatus, errorThrown) {
        console.log("The following error occured: " + textStatus, errorThrown);
    }
})

I tried many thing, like add cache: flase, and added timestamp to the link but the problem is still

The code is work good in the other browsers

The code for the add_product1 function is:

public function add_product1 ()
{
    print_r($_POST);    
}

But the result is : Array()

Your help please

Thank you

  • 写回答

2条回答 默认 最新

  • weixin_33725272 2014-05-23 15:43
    关注

    Can you try this

     data: {
            "job_id": item.job_id,
            "quantity": item.quantity,
            "price": item.price,
            "media_code": item.media_code,
            "product_id": item.layout_code,
            "product_name": item.product_name,
            "reedit_url": item.reedit_url,
            "thumb_url": item.thumb_url
        },
    

    Not really sure if this is the problem but it might be an IE quirk

    评论

报告相同问题?