Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 89916b7

Browse files
author
Gabriel Schulhof
committed
Toolbar: Add <head> to markup in view source and explanatory blurb
1 parent d2fa7e2 commit 89916b7

File tree

1 file changed

+15
-5
lines changed
  • demos/toolbar-fixed-persistent-optimized

1 file changed

+15
-5
lines changed

demos/toolbar-fixed-persistent-optimized/index.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<?php if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest') { ?>
22
<!DOCTYPE html>
33
<html>
4-
<head>
4+
<head id="document-head">
5+
6+
<!-- The various documents reachable from within your navigation system must all have the
7+
necessary header information to be able to launch your application. Nevertheless, the
8+
server only needs to send this header information with the first request by the user. On
9+
Ajax requests by the application, this information can be discarded server-side in order
10+
to save bandwidth and to improve the time it takes to display a page. -->
511
<meta charset="utf-8">
612
<meta name="viewport" content="width=device-width, initial-scale=1">
713
<title>Ajax optimized persistent toolbars - jQuery Mobile Demos</title>
@@ -12,13 +18,17 @@
1218
<script src="../../external/jquery/jquery.js"></script>
1319
<script src="../_assets/js/"></script>
1420
<script src="../../js/"></script>
21+
22+
<!-- This script contains the code that is shared between all the documents of your
23+
application. It is responsible for enhancing the shared widgets during your application's
24+
startup. -->
1525
<script id="shared-widget-init" src="shared-widget-init.js"></script>
1626
</head>
1727
<body>
1828
<div id="shared-header" data-role="header" data-position="fixed" data-theme="a">
19-
<!-- Shared header markup must be added to all pages of the demo to ensure any of them can
20-
serve as the start page. The server can be instructed to omit sending this portion of
21-
the data whenever the request for the document is made via Ajax. -->
29+
<!-- Shared header markup must be added to all documents of the demo to ensure any of them
30+
can serve as the start page. The server can be instructed to omit sending this portion
31+
of the data whenever the request for the document is made via Ajax. -->
2232
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
2333
<a href="#nav-menu" data-rel="popup" class="ui-btn ui-btn-right ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-right ui-icon-navigation">Navigation</a>
2434
<div data-role="popup" id="nav-menu" data-theme="a">
@@ -50,7 +60,7 @@
5060

5161
<h2>Shared scripts and widgets</h2>
5262
<p>Any one of the pages in this demo must be able to serve as the start page for your application. Thus, when accessed via plain HTTP, the server will return the full page, including references to jQuery and jQuery Mobile, as well as custom scripts which ensure that widgets shared by all the pages in the application are initialized at startup, no matter which page the user chooses as their start page. Thus, you must copy references to jQuery, jQuery Mobile, and your custom startup script(s) to the <code>&lt;head&gt;</code> section of each of your documents, and all shared widgets to the corresponding <code>&lt;body&gt;</code> section.</p>
53-
<div data-demo-html="#shared-header,#shared-navbar" data-demo-js="#shared-widget-init"></div>
63+
<div data-demo-html="#document-head,#shared-header,#shared-navbar" data-demo-js="#shared-widget-init"></div>
5464

5565
</div><!-- /content -->
5666

0 commit comments

Comments
 (0)