I am trying to implement a switch that shows/hides some elements depending on its state.
No event fired. Tried changing onchange to onclick to no avail.
Then I removed the onchange declaration from in there and placed it in some initialisation script, like:
$('#cb1').on('change', function() { ... });
$('#cb1').on('click' , function() { ... });
Again, no luck here. The switch ui seems to be updating the element's DOM, but not events are being fired thereafter.
This, at the very least is very counter-intuitive in an otherwise very intuitive framework to program with.
Now, I've tested this in at least 6 browsers and the behaviour is the same:
Mac / Safari
Mac / Chrome
Mac / Firefox
iPhone / Safari
iPhone / Chrome
Android / Chrome
Android / (native browser on 4.4.2)
Android / (native browser on 4.0.4)
After extensive googling, the only way to catch this reliably is with the following method:
$('[name="some"]').bind("DOMSubtreeModified", function(event) { ... });
But, guys, please... this is no way, to go from London to Paris via Beijing. For a commercial product, this is not excusable.
Trian