Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

1.0b1 works with domcache = true and removing prev pages on pageshow

  • Loading branch information...
commit 957fd3b9c8724413a3cdb75850f31e2679e5b267 1 parent 63e1edb
@dgeb authored
Showing with 104 additions and 0 deletions.
  1. +28 −0 a.html
  2. +20 −0 app.js
  3. +28 −0 b.html
  4. +28 −0 c.html
View
28 a.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Page A</title>
+ <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
+ <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
+ <script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
+ <script src="app.js"></script>
+</head>
+<body>
+<div data-role="page">
+ <div data-role="header">
+ <div data-role="navbar">
+ <ul>
+ <li><a href="a.html" class="ui-btn-active">A</a></li>
+ <li><a href="b.html">B</a></li>
+ <li><a href="c.html">C</a></li>
+ </ul>
+ </div>
+ </div>
+ <div data-role="content">
+ Page A loaded: <span class="load-time">...</span>
+ </div>
+</div>
+</body>
+</html>
View
20 app.js
@@ -0,0 +1,20 @@
+$(document).bind("mobileinit", function() {
+ $.mobile.page.prototype.options.domCache = true;
+});
+
+$('div').live('pageshow',function(event, ui) {
+ if (ui.prevPage) ui.prevPage.remove();
+});
+
+$(document).bind('pagecreate',function(event, ui) {
+ var now = new Date();
+ var hours = now.getHours();
+ var minutes = now.getMinutes();
+ if (minutes < 10) minutes = "0" + minutes;
+ var seconds = now.getSeconds();
+ if (seconds < 10) seconds = "0" + seconds;
+
+ var page = $(event.target);
+ page.find('.load-time').text(hours + ":" + minutes + ":" + seconds);
+});
+
View
28 b.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Page B</title>
+ <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
+ <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
+ <script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
+ <script src="app.js"></script>
+</head>
+<body>
+<div data-role="page">
+ <div data-role="header">
+ <div data-role="navbar">
+ <ul>
+ <li><a href="a.html">A</a></li>
+ <li><a href="b.html" class="ui-btn-active">B</a></li>
+ <li><a href="c.html">C</a></li>
+ </ul>
+ </div>
+ </div>
+ <div data-role="content">
+ Page B loaded: <span class="load-time">...</span>
+ </div>
+</div>
+</body>
+</html>
View
28 c.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Page C</title>
+ <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
+ <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
+ <script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
+ <script src="app.js"></script>
+</head>
+<body>
+<div data-role="page">
+ <div data-role="header">
+ <div data-role="navbar">
+ <ul>
+ <li><a href="a.html">A</a></li>
+ <li><a href="b.html">B</a></li>
+ <li><a href="c.html" class="ui-btn-active">C</a></li>
+ </ul>
+ </div>
+ </div>
+ <div data-role="content">
+ Page C loaded: <span class="load-time">...</span>
+ </div>
+</div>
+</body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.