1

I have some code that is working to pull an xml value using jQuery $.ajax however once the application is running in the browser any changes to the xml .doc and a subsequent browser refresh does not display the new saved xml value xmlImagePath.

What can be done to force the new xml value on browser refresh?

    $.ajax({
        type: "GET",
        url: "/Images/referal_Image_Config.xml",
        dataType: "xml",
        success: function (xml) {
            //read xml file
            $(xml).find('image').each(function () {
                if ($(this).attr('active') == 'true') {
                    var xmlImagePath = $(this).find('pathName').text();
JoJo
  • 4,643
  • 9
  • 42
  • 65

1 Answers1

1

Set the cache property of $.ajax to false:

$.ajax({
    type: "GET",
    url: "/Images/referal_Image_Config.xml",
    dataType: "xml",
    cache: false,
    success: function (xml) {
        // your code...
    }
 });
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339