Why my jquery function is not firing on Firefox
- by Cristian Boariu
I have some trouble with some jquery method (for some checkboxes I want them to fire on checked/unchecked so I can do something then).
This method works perfectly on Chrome and IE but not on latest FF.
jQuery(function () {
jQuery(':checkbox').change(function () {
var counter = jQuery('.count').text();
var thisCheck = jQuery(this);
if (thisCheck.is(':checked')) {
counter++;
//apply green color to the selected row
jQuery(this).closest('tr').addClass('checked');
} else {
counter--;
//remove green color to the selected row
jQuery(this).closest('tr').removeClass('checked');
}
jQuery('.count').html(counter);
//enable export button when there are selected emails to be exported
if (counter > 0) {
jQuery(".exportButton").removeAttr("disabled", "");
} else {
jQuery(".exportButton").attr("disabled", "disabled");
}
});
});
Basically it's simply not firing...Even with Debug is not catching the first line (function declare nor other lines too).
If I move this javascript(without function declare) inside jQuery(document).ready(function ($) { all works nice on Firefox too...
Yes, I do use jQuery.noConflict(); before jQuery(document).ready(function ($) {
Do you know why this happens?