Skip to content

Instantly share code, notes, and snippets.

@theonewolf
Created August 11, 2013 20:40
Show Gist options
  • Select an option

  • Save theonewolf/6206769 to your computer and use it in GitHub Desktop.

Select an option

Save theonewolf/6206769 to your computer and use it in GitHub Desktop.
minimal changePage() jQuery Mobile example
<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