i have 3 php pages, 1 index page and 2 other subpages which have links (sales and products) in the index page. when i click on sales, it is suppode to load sales data on pageint
or document ready
as am using below to debug.
$('[data-role="page"]').live('pageshow', function () { <-- error line
console.log("pageshow");
});
$(document).on('pageinit', function(){
console.log("pageinit");
});
$(document).ready(function(){
console.log("docready");
})
none of the code fire when i click the link on in index page, but when the page is loaded and i refresh, i get a javascript error indicated by the error line
Object [object Object] has no method 'live'
i am using
jquery.1.9.1.min.js
jquery.mobile.1.3.2.min.js
the html of the index page is
<div data-role="page" data-ajax="false" id="home">
<?php include_once("header.php");?>
<div data-role="content" data-theme="">
<ul data-role="listview" data-divider-theme="b" data-inset="true">
<li data-role="list-divider" role="heading">Menu</li>
<li data-transition="flip">
<a href="outgoing.php" data-transition="slide" data-ajax="true">sales </a>
</li>
<li data-transition="flip">
<a href="settings.php" data-transition="slide" data-ajax="true">products</a>
</li>
<li>
<a href="../logout.php">Logout</a>
</li>
</ul><div data-role="navbar" data-iconpos="">
</div>
</div>
<div data-role="footer" data-theme="b">
<?php include_once("../footer.php");?></h4>
</div>
</div>
what am i doing wrong?
Edit
I updated my code as to $('[data-role="page"]').on('pageshow', function () {
, but non of the functions fire except i refresh the page manually after it has been full loaded