Saturday, March 8, 2014

jquery mobile with two pages in the given example, i.e two main div's with data-role="page", here the the first data-role="page" will display in our browser, if we simply remove the data-role="page" for one page, the second page will display
Note: The data-role="page" is the page displayed in the browser, if we remove data-role="page" for both pages..the two pages will display here in the output.

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js"></script>
</head>
<body>

<div>
  <div data-role="header" data-role="page">
    <h1><a href="#pageonew">Buttons1</a></h1>
  </div>

  <div data-role="main" class="ui-content">
    <input type="button" value="Button">
  </div>

  <div data-role="footer">
    <h1>Footer Text</h1>
  </div>
</div>


<div id="pageonew" data-role="page">
  <div data-role="header">
    <h1><a href="#pageone">Buttons2</a></h1>
  </div>

  <div data-role="main" class="ui-content">
    <input type="button" value="Button">
  </div>

  <div data-role="footer">
    <h1>Footer Text</h1>
  </div>
</div>
</body>
</html>

What will happen if remove data-role="page"? what is the output.
the o/p may vary from browser to browser.



No comments:

Post a Comment