jQuery live, change in not working in IE6, IE7
- by fabian
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]);
}
});
});
});