jQuery .ajax method in IE7 & IE6 not working but working fine in Firefox

Posted by RyanP13 on Stack Overflow See other posts from Stack Overflow or by RyanP13
Published on 2010-02-23T17:01:27Z Indexed on 2010/05/14 1:14 UTC
Read the original article Hit count: 428

Filed under:
|
|

This relates to my previous post:

http://stackoverflow.com/questions/2318696/jquery-load-method-causing-page-refresh-ajax

I changed my implmentation to use the .ajax method instead of .load and it works fine in Firefox but not in IE7 or IE6:

    $('ul#coverTabs > li > a').live('click', function(event) {

    // Find href of current tab
    var $tabValue = $(this).attr('href');

    $.ajax({
        type: "GET",
        cache: false,
        dataType: "html",
        url: $(this).attr('href'),
        success: function(data){

        $(data).find('.benefitWrap').each(function(){

            var $benefitWrap = $(this).html();

            $('.benefitWrap').replaceWith($('<div class="benefitWrap">' + $benefitWrap + '</div>'));

        });

       }

    });

    event.preventDefault(); 

});

This is killing me as it has taken ages to get this far.

Any ideas where i am going wrong?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX