this script works in firefox or chrome, but only gets half way in IE9, which is the best browser for our websites.
im im problem is that it throws this error.
SCRIPT438: object does not support property or method 'append' calc_ajax.js, line character 26
in this line: item.append (link);
and I'm stuck why. Any help would be greatly appreciated.
$(document).ready(function(){ $('.first a.btn').click(function(){ $('.first a.active').removeClass('active'); $(this).addClass('active'); $('.second .title').addClass('active'); var id = $(this).data('cat-id'); var wrap = $('<div>'); $.ajax({ url: script_url, type: "post", data: {"cat": id}, dataType: "json" }).success(function(result){ if(result.status == "ok"){ $.each(result.data, function(i, elem){ item = $("<div class='body-area'>").append($("<img src='" + elem.image + "'>")); link = $("<a href='#results' class='btn'>"); link.text(elem.name); link.data('subcat-id', elem.id); item.append(link); wrap.append(item); }); $('.second .body').html(wrap).slideDown('fast'); } }); }); $('.second a.btn').live('click', function(){ $('.second .body-area.active').removeClass('active'); $(this).parent().addClass('active'); var sub_id = $(this).data('subcat-id'); $.ajax({ url: script_url, type: "post", data: {"subcat": sub_id}, dataType: "json" }).success(function(result){ if(result.status == "ok"){ $('.third .title').text(result.data.title); $('.third .body').html(result.data.body); $('.third').slideDown('fast'); } }); });
});
source share