jQuery live, change in not working in IE6, IE7

Posted by fabian on Stack Overflow See other posts from Stack Overflow or by fabian
Published on 2009-09-20T19:12:00Z Indexed on 2010/04/07 4:33 UTC
Read the original article Hit count: 172

The code below works as expected in FF but not in IEs...

$(document).ready(function() {

    $('div.facet_dropdown select').live('change', function() {
        var changed_facet = $(this).attr('id');
        var facets = $('select', $(this).closest('form'));
        var args = window.location.href.split('?')[0] + '?ajax=1';
        var clear = false;
        for(var i = 0; i < facets.length; i++) {
            var ob = $(facets[i]);
            var val = ob.val();
            if(clear) {
                val = '';
            }
            args += '&' + ob.attr('id') + '=' + val;
            if(ob.attr('id') == changed_facet) {
                clear = true;
            }
        }

        $.getJSON(args, function(json) {
            for(widget_id in json) {
                var sel = '#field-' + widget_id + ' div.widget';
                $(sel).html(json[widget_id]);
            }
        });

    });

});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about internet-explorer