jqueryajaxcaching

How to get rid of the underscore query parameter that jQuery adds to AJAX requests?


I am using jQuery and running this Javascript:

$.ajax ({
    url: 'http://1.1.1.1/cgi-bin/script.cgi?scm:scm/data/system_names',
    context: $("#elem"),
    crossDomain: true,
    dataType: "xml",
    success: function (data) {
        $xmlDoc = parseXML (data);
        $(this).html ($xmlDoc.find ("elem").text ());
    }
});

When the requests runs, I can see that this URL is requested:

http://1.1.1.1/cgi-bin/script.cgi?scm:scm/data/system_names&_=1306868212809

How can I get rid of the &_=1306868212809 part? It's messing with my request. I have no control over the CGI script, so I have to do it the way you see.


Solution

  • Try setting the cache parameter:

    cache: true