Created
August 11, 2013 20:40
-
-
Save theonewolf/6206769 to your computer and use it in GitHub Desktop.
minimal changePage() jQuery Mobile example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" /> | |
| <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
| <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> | |
| <script> | |
| function switcher() { | |
| console.log('entering switcher()') | |
| $.mobile.changePage($("#page2")); | |
| console.log('switcher() just ran'); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <div data-role="page" id="page1"> | |
| <p>Welcome. This is page1.</p> | |
| <button type="submit" onclick="switcher();">Page 2</button> | |
| </div> | |
| <div data-role="page" id="page2"> | |
| <p>SALAAM NAMASTE! This is page2.</p> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment