The following code works only in Firefox, but not in IE. The word "Meanscoil na mBraithre Criostaí" brakes the JSON file:
"2028425":[19, "Awaiting Correction", "", "Meanscoil na mBraithre Criostaí"],
$(document).ready(function() {
$('#ticketsearch').click(function() {
var ticketcode = $('[name=ticketcode]').val();
$.getJSON('/import/envelope.json', function(data) {
$('.ticket').text(data[ticketcode][3]);
$('.envstatus').text(data[ticketcode][1]);
$('.track').text(data[ticketcode][2]);
$('.track').attr("href", data[ticketcode][2]);
});
});
});
PS> How can I clear cache after each JSON request.
Caching issues...
Note that IE is the only browser platform that utilizes caching in AJAX requests because they treat an AJAX request no different then a normal browser request.
$(document).ready(function() {
$('#ticketsearch').click(function() {
var ticketcode = $('[name=ticketcode]').val();
$.getJSON('/import/envelope.json', function(data) {
$('.ticket').text(data[ticketcode][3]);
$('.envstatus').text(data[ticketcode][1]);
$('.track').text(data[ticketcode][2]);
$('.track').attr("href", data[ticketcode][2]);
$.ajaxSetup({ cache: false }); // <------this will disable caching
});
});
});