Reputation: 7283
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.
Upvotes: 2
Views: 299
Reputation: 1428
You need to set the cache
key to true
$.ajax ({
url: 'http://1.1.1.1/cgi-bin/script.cgi?scm:scm/data/system_names',
context: $("#elem"),
crossDomain: true,
dataType: "xml",
cache: true,
success: function (data) {
$xmlDoc = parseXML (data);
$(this).html ($xmlDoc.find ("elem").text ());
}
});
Upvotes: 1
Reputation: 24102
Shouldn't you be wrapping the URL in string quotes?
$.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 ());
}
});
From their documentation - http://api.jquery.com/jQuery.ajax/
The Url
property should be a string
.
Upvotes: 0