Utilizing Ajax to verify data and display it on the page, alongside implementing varnish cache. The data appears correctly on all web browsers, with the exception of IE 11, unless the varnish cache is disabled.
function checkMyData() {
var surl = 'index.php?eID=thismydata';
if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) {
surl += '&hash=' + Math.random();
}
$.ajax({
type: "GET",
url: siteurl + surl,
asynchronous: true,
data: 'mode=datalist' +
'&initdatalist=' + initdatalist +
'&datastr=' + datastr,
success: function (answer) {
var response;
try {
response = eval('(' + answer + ')');
} catch (err) {
alert('Err: ' + answer);
return;
}
if (initdatalist == 1)
initdatalist = 0;
$basic_cont = '<div class="row"><div class="col-md-6 col-md-offset-3"><p class="data-title">' +
response.firstmatch + response.otherdata + '</p></div></div>' +
response.matches;
$("#thisdaydata").empty();
$($basic_cont).appendTo("#thisdaydata");
}
});
}
HTML Output for all browsers (excluding IE 11):
<div id="thisdaydata">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<p class="data-title">data here</span></p>
</div>
</div>
HTML Output for IE 11:
<div id="thisdaydata"></div>
Is this Ajax code not compatible with IE 11?