I am unable to use delegate() in Internet explorer 8. It just does not recognise the event at all. It works in Firefox like a charm. I have heard some people say that they can get it to work by re-ordering their code, but hoping someone can give advice:
// REMOVING PRODUCTS:
$("#items").delegate("img","click",function() {
var prodID = $(this).attr("name");
// REMOVE PURCHASED ICON:
var className = $("#gameImg area[name='"+prodID+"']").attr("id");
$("."+className).remove();
if(haveProduct(prodID) === true) {
// REMOVE FROM ARRAY:
var arrPos = $.inArray(prodID, productsAdded);
productsAdded.splice(arrPos,1);
addCash(prodID);
buildItems();
} else {
alert("You have not purchased this product.");
}
});
I resolved the issue by looking for CSS issues 🙂 The dynamic content created’s position was not correct with the mouse cursor, hence when I tried to click on it it did not work.