FIREFOX: 'accept' Button no click event
-
Problem: Firefox (OS X and Windows) does not fire the “click” event if one clicks the html ‘accept’ button.
Cause: The reason is that the DOM is not existing when the jQuery(document).ready()… function is compiled by Firefox. This problem does not affect Safari or Chrome.
Solution: Usage of jQuery(‘#elementID’).live(‘click’, function ()….); This ensures that the binding of events takes place now or in future during DOM creation (see also jQuery live or http://encosia.com/dont-let-jquerys-document-ready-slow-you-down/
Code snippet of a part of EU cookie law:
WRONG:
jQuery(“#pea_cook_btn, .eucookie”).click(function() { //
euCookieConsent();
});WORKS PERFECT:
jQuery(“#pea_cook_btn, .eucookie”).live(‘click’, function () {
euCookieConsent();
});Dear developer team, please correct your ‘scripts.js’ file as soon as possible, otherwise your plugin is useless at least under Firefox.
Best regards!
The topic ‘FIREFOX: 'accept' Button no click event’ is closed to new replies.