Tuesday, September 8, 2009

Jquery: Checkbox and change

Jquery has a nice function called change ($(element).change(function(){});

Sadly (as usual) that piece of shit browser named Internet Explorer, wont trigger it.
Soon enough (on private sites) i'll have to start adding a browser check at the start of every page using the following pseudo code: 

if browser is IE
display "Sorry but your browser is broken, get firefox! (link: www.getfirefox.com)"
else
display page


For now, the quick workaround is to use the click method on the input, like so:

$("input._alerts").click(function(){alert("chk was clicked");});