Pergunta

i have a list of records and on each record, if I click I go to a different page.

On the 2nd page, i change the status of the record. I change the status on changing a value in the dropdown. when I change the value in the dropdown, i call an api to commit the change. after the success call I am redirecting users to the list page where records should have changed status value.

this works in all browser but NOT IN I.E (Not even in i.e. 11)

In I.E, when i go to the list page I see the old value untill I press f5 and refresh.

the following code is running when I change the status of my record in the 2nd page.

function changeStatus(status)
{
    $.ajax({
        type: "GET",
        url: "api call url",
        dataType: "xml",
        async: false,
        success: function (data) {
           // alert("success call");
            window.location = "list url"; // adding a datetime() here, doesn't give me any luck.

        },
        error: function () {
            alert("Error");
        }
    });


}

i tried many things, including putting a datetime in the url with no luck. is there any workaround?

Foi útil?

Solução

You can make use of the cache setting (jQuery reference)

function changeStatus(status)
{
    $.ajax({
        type: "GET",
        url: "api call url",
        dataType: "xml",
        async: false,
        cache: false,
        success: function (data) {
           // alert("success call");
            document.location = "list url"; // adding a datetime() here, doesn't give me any luck.

        },
        error: function () {
            alert("Error");
        }
    });
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top