I'm using jQuery .load()
to include some HTML in my page. The content is shown as expected but all the events bounds to the included HTML aren't working
$('.main').empty().load("foo.html");
$(function() {
$('select').on('change', function(){
alert('bar');
});
});
It works on desktop but not on mobile. I cannot figure out why... I suppose that the load()
function is responsible for that, because as soon as I put the HTML content directly in the main page, it works...