Friday, December 7, 2012

Clear Cache When made an Ajax Request?


Best choice is add the timestamp to ajax url.its perfect working
var timestamp=Number(new Date());
var url="YoursUrl? timekey="+timestamp;


     OR

Below code is also working but not gurrente

$.ajax({
    type: "POST",
    async: true,
    url: "/manage/update_position/",
    data: {
        "action": action.
        "model": model,
        "object_id": object_id,
        "position": position
    },
    cache: false,
    dataType: "json",
    success: function(data){
        //[snip]
    }
});



No comments:

Post a Comment