I have a webpage disigned for mobile devices, most of the data is loaded into it via AJAX request and appended to the BODY with jQuery, so far it works just fine.However, when I try to attach an on click listener, the following listener doesn't work for any browser
$('[id^="the_content"]').click(function () {
...
});
I've solved this problem by using the On() method. the following code work perfectly on all browsers (tested on Chrome,FF,IE,Safari for windows). except for the build browser.
$(document).on("click",'[id^="the_content"]',function() {
...
});
Note that these listeners does work for data which was not appended via JS/jQuery
Note that my code pass W3C HTML5 validation with no errors at all.
Have anyone faced such a problem?
div example:
<div id='the_content_id_61'>...</div>