the following jQuery code will execute every "pagecreate" but I only ever read "I come from the foo down bar." I never, however have read "Where rivers foo and bar thunder!". I can assure you my markup has plenty of division tags.
$(document).on("pagecreate", "#index", function () {
alert("I come from the foo down bar.");
$("div").on("tap", function () {
alert("Where rivers foo and bar thunder!");
$(this).hide();
});
});
Here is a simplified example of a failed page:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title><link href="/Content/jquery.mobile-1.4.2.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.theme-1.4.2.css" rel="stylesheet"/>
<link href="/Content/jquery.mobile.structure-1.4.2.css" rel="stylesheet"/>
<link href="/Content/themes/mobile.css" rel="stylesheet"/>
<link href="/Content/themes/jquery.mobile.icons.min.css" rel="stylesheet"/>
<link href="/Content/Mobile/Site.css" rel="stylesheet"/>
<link href="/Scripts/jquery-2.1.0.js" rel="stylesheet"/>
<link href="/Scripts/Mobile/Warning.js" rel="stylesheet"/>
<link href="/Scripts/jquery.mobile-1.4.2.js" rel="stylesheet"/>
</head>
<body>
<form method="post" action="DefaultISH.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="VHiLIso4vJwEKglDsP400Owtzfidxc4g1kzhU450G4jeIhwpxe/oiIWD8Tv7WzOAgPDpiSp229wXt2ML2qVRUPcH+Vh/Do2FlIV7M5yxYug=" />
</div>
<div id="index" data-role="page">
<p>Dos eat oats.</p>
</div>
</form>
<script>
$(document).on("pagecreate", "#index", function () {
alert("I come from the foo down bar.");
$(document).on("tap click vclick", "p", function () {
alert("Where rivers foo and bar thunder!");
$(this).hide();
});
});
</script>
<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
{"appName":"Firefox","requestId":"7a541c555bc144bd927e24c1375eea63"}
</script>
<script type="text/javascript" src="http://localhost:50293/91b671a7150345b7859822835d8e2556/browserLink" async="async"></script>
<!-- End Browser Link -->
</body>
</html>
For an example of the problem on JSFiddle
For a working example, which I wish to implement.