-
Notifications
You must be signed in to change notification settings - Fork 69
/
test-bC.html
88 lines (74 loc) · 2.81 KB
/
test-bC.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="../js/jquery.mobile.router.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript">
var router=new $.mobile.Router([
{ "#localpage2(?:[?/](.*))?": {handler: "localpage", events: "bc,c,i,bs,s,bh,h"} },
{ "#index": {
handler: function(type){
console.log("Index has been "+(type=="pagehide"?"hidden":"shown"));
}, events: "h,s" }
},
{ "#localpage4(?:[?/](.*))?": {handler: "testDocEvts", events: "bC" } }
],{
localpage: function(type,match,ui){
console.log("localpage2: "+type);
console.log(match);
},
testDocEvts: function(type,match,data,scope,e){
console.log("document event! "+type);
e.preventDefault();
if (typeof(data.toPage)!=="string") return;
$.mobile.changePage( $('<div data-role="page" data-url="localpage4"><div data-role="header"><h1>title</h1></div><div data-role="content">page4content<a data-role="button" href="#index">back to index</a></div></div>').appendTo("body") );
}
});
</script>
</head>
<body>
<div data-role="page" id="index">
<div data-role="header">
<h1>Index</h1>
</div>
<div data-role="content">
<p>Page 1</p>
<p>The output of this page can be seen in your javascript console.</p>
<p>
The following link will show how to inject a page using the pagebeforechange evt<br/>
<a href="#localpage4?uiuiuouo">#localpage4</a><br/>
</p>
</div>
<div data-role="footer">
<h4>Index footer</h4>
</div>
</div>
<div data-role="page" id="localpage2" data-add-back-btn="true">
<div data-role="header">
<h1>Localpage 2</h1>
</div>
<div data-role="content">
<p>This is the localpage 2 in the multipage template.</p>
<p><a href="#index">Back to index</a></p>
</div>
<div data-role="footer">
<h4>Localpage 2 Footer</h4>
</div>
</div>
<div data-role="page" id="localpage3" data-add-back-btn="true">
<div data-role="header">
<h1>Localpage 3</h1>
</div>
<div data-role="content">
<p>This is the localpage 3 in the multipage template.</p>
<p><a href="#index">Back to index</a></p>
</div>
<div data-role="footer">
<h4>Localpage 3 Footer</h4>
</div>
</div>
</body>
</html>