6
Lavorare con jQuery 1.8.3
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/jquery.mobile-1.3.0.min.js"></script>
<script>
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
$("#home").live("pageshow", function(event) {
alert("Ok. This is Home!");
});
</script>
</head>
<body>
<!--- HOME --->
<div data-role="page" id="home">
<h2>Hello World</h2>
</div>
</body>
</html>
Alert funziona bene.
Tuttavia, con jQuery 1.9.1 (si ricorda che ho cambiato la versione e "live" con "on"
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/jquery.mobile-1.3.0.min.js"></script>
<script>
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
$("#home").on("pageshow", function(event) {
alert("Ok. This is Home!");
});
</script>
</head>
<body>
<!--- HOME --->
<div data-role="page" id="home">
<h2>Hello World</h2>
</div>
</body>
</html>
Alert non funziona. sono sicuro che sto facendo qualcosa di sbagliato. I'. Ho letto che jQuery Mobile 1.3.0-stable userebbe jQuery 1.9.1, ma forse ho sbagliato.
Grazie mille, distroio. Ho fatto un casino con la sytnax. – Hookstark