My first PhoneGap application has 2 HTML files.
The first is called index.html , which uses index.js . A list item will be displayed in this file. When I click an item in this list, it brings me to the detail.html file as follows:
$.mobile.changePage("detail.html", { transition: "slideup"});
OR
location.href = "detail.html";
On the detail.html page, detail.html load detal.js . However, this did not work. I could not use functions in detail.js .
Please give me your advice and is there any example?
Capture photo
<link rel="stylesheet" href="css/jquery.mobile.structure-1.3.0.min.css" /> <link rel="stylesheet" href="css/jquery.mobile-1.3.0.min.css" /> <link rel="stylesheet" href="css/getAbstract.min.css" /> <script src="js/jquery-1.9.0.min.js"></script> <script src="js/jquery.mobile-1.3.0.min.js"></script> <script src="js/jquery.ba-dotimeout.js"></script> <script src="js/jquery.dst.js"></script> <script type="text/javascript" charset="utf-8" src="js/cordova-2.5.0.js"></script> <script type="text/javascript" charset="utf-8"></script> </head> <body> <div data-role = "page" data-theme = "a" id = "pageContainer"> <div data-role = "header" id = "pageHeader" data-nobackbtn = "true" data-position = "fixed"> <h1>Camera</h1> </div> <div data-role = "content" id= "pageContent"> <a data-role = "button" id = "btnCaptureEdit" href = "">Capture Edit</a> <a data-role = "button" id = "btnLibraryPhoto" href = "">Get Photo From Library</a> <a data-role = "button" id = "btnAlbumPhoto" href = "">Get Photo From Album</a> </div> <div data-role = "footer" id = "pageFooter"> </div> </div> <script src="js/detail.js"></script> </body> </html>
source share