I'm trying to bind to the click/touchstart events after loading HTML via jQuery.load like so:
var screen = $("#somediv");
function LoadScenarioScreen(){
screen.empty();
screen.load('templates.html #ScenarioSelect',function(){
$(document).on('click touchstart','div#squishy_box', function(e){
alert('hello');
});
});
}
Loading the HTML works great, but binding to an element within that HTML won't. I'm using the jQuery 1.11 and trying this via Icenium on the simulator and my iPad. Removing the optional selector from the .on function has the click working fine, but otherwise nothing.
EDIT: no point in posting piles of HTML but the first part of the loaded document is this:
<div id="ScenarioSelect">
<div class="box">
<div id="squishy_box" class="arrow_box">