The site is http://www.basketbasics.com Click on, for instance, Dyes.
This routine uses a jquery module, jquery.sticky.js; the module doesn't appear to be the issue.
The code has language to avoid IE but this doesn't work for IE11. I prefer finding a fix so it works in all recent versions of IE.
On startup, Sidecart() is called.
When you order something (put a quantity in a field then move out of the field) an ajax call is made to add data to a session variable. The callback is callbackSubmit() (The parameter stuff is immaterial here.)
function callbackSubmit(stuff) { if ( navigator.userAgent.indexOf('MSIE') == -1 ) {Sidecart() } }
function Sidecart() {
$("#orderbody").children().detach().remove();
$.ajax({
url:'Sidecart.cfm',
//Sidecart.cfm outputs the session info and returns the data read in the callback
success:function(data){callbakSidecart(data)},
error: function(e){ console.log(e); }
});
}
function callbakSidecart(stuff) {
var x = stuff.split('|');
var z = parseInt(x[0])*3+2;
if ( x[0] > 0 ) {
for ( var i = 2; i<z;i+=3 ){
$('#orderbody').append("<tr><td colspan='2' class='smaller'>" + x[i] + "</td></tr><tr><td class='smaller'>" + x[i+1] + "</td><td class='smaller'>" + x[i+2] + "</td></tr><tr><td colspan='2'><hr></td></tr>");
}
$('#orderbody').append('<tr><td colspan="2">Total: ' + x[1] + '</td></tr>');
}
}
The structure it is referencing is a table with a tbody id=orderbody
Suggestions for better code are welcome but I'm not concerned here about how tables are bad, etc. The question is why does it work in FF, Chrome, Opera and Safari but doesn't work right in IE?