|
14 | 14 | padding: 10px; |
15 | 15 | } |
16 | 16 | ]]></css> |
17 | | - <html><![CDATA[ <div data-role="header"> |
18 | | - <h1>Page 1</h1> |
19 | | - </div> |
20 | | - <div data-role="content"> |
21 | | - <a href="#page2" data-role="button" data-inline="true">Go to Page 2</a> |
22 | | - <input type="button" value="Which Page is this?" class="myButton" data-inline="true"/> <br> |
23 | | - <div class="myResult">The result will be displayed here</div> |
24 | | - </div> |
| 17 | + <html><![CDATA[<div data-role="header"> |
| 18 | + <h1>Page 1</h1> |
25 | 19 | </div> |
| 20 | + <div data-role="content"> |
| 21 | + <a href="#page2" data-role="button" data-inline="true">Go to Page 2</a> |
| 22 | + <input type="button" value="Which Page is this?" class="myButton" data-inline="true"/> <br> |
| 23 | + <div class="myResult">The result will be displayed here</div> |
| 24 | + </div> |
| 25 | +</div> |
26 | 26 | |
27 | | - <div data-role="page" id="page2"> |
28 | | - <div data-role="header"> |
29 | | - <h1>Page 2</h1> |
30 | | - </div> |
31 | | - <div data-role="content"> |
32 | | - <a href="#page1" data-role="button" data-inline="true">Go to Page 1</a> |
33 | | - <input type="button" value="Which Page is this?" class="myButton" data-inline="true"/> <br> |
34 | | - <div class="myResult">The result will be displayed here</div> |
35 | | - </div>]]></html> |
36 | | - <code><![CDATA[ |
37 | | - $(function() { |
38 | | - $( ".myButton" ).on( "click", function() { |
39 | | - var whichPageId = $.mobile.activePage.attr( "id" ); |
40 | | - $( ".myResult" ).html( "This is " + whichPageId ); |
41 | | - }); |
| 27 | +<div data-role="page" id="page2"> |
| 28 | + <div data-role="header"> |
| 29 | + <h1>Page 2</h1> |
| 30 | + </div> |
| 31 | + <div data-role="content"> |
| 32 | + <a href="#page1" data-role="button" data-inline="true">Go to Page 1</a> |
| 33 | + <input type="button" value="Which Page is this?" class="myButton" data-inline="true"/> <br> |
| 34 | + <div class="myResult">The result will be displayed here</div> |
| 35 | + </div>]]></html> |
| 36 | + <code><![CDATA[ |
| 37 | +$(function() { |
| 38 | + $( ".myButton" ).on( "click", function() { |
| 39 | + var whichPageId = $.mobile.activePage.attr( "id" ); |
| 40 | + $( ".myResult" ).html( "This is " + whichPageId ); |
42 | 41 | }); |
43 | | - ]]></code> |
| 42 | +}); |
| 43 | +]]></code> |
44 | 44 | </example> |
45 | 45 | <category slug="properties"/> |
46 | 46 | </entry> |
0 commit comments