JQuery Mobile & Head.js Issues
Hi all,
I'm trying to integrate just the javascript loader portion of head.js with my JQM website.
I'm having a couple of issues:
1. On some pages, I'm seeing the script block that I'm trying to load with head.js loaded 3-4 times on the page.
2. On all pages, I'm seeing a substantial period of unstyled content (FOUT). The styling does eventually load.
Here's some sample code that illustrates each issue:
1.
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="ISO-8859-1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
- <title>Main Menu</title>
- <!-- JQM CSS -->
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
- <!-- Custom Theme CSS -->
- <link rel="stylesheet" href="themes/cayce.css" />
- <!-- Custom CSS -->
- <link rel="stylesheet" href="css/custom.css" />
- <script src="js/head.load.min.js"></script>
- <script>
- head.js("http://code.jquery.com/jquery-1.8.2.min.js", "js/custom.js", "http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js");
- </script>
- </head>
- <body>
- <div data-role="page" id="landing">
- <div data-role="header">
- <h1>Main Menu</h1>
- <div class="header-sub">
- <div class="logo">
- <a href="WebCatPageServer.exe?Landing">
- <img src="themes/images/logo.png" width="100" height="49" alt="Company Logo">
- </a>
- </div>
- </div>
- <!-- Search Bar-->
- <div class="ui-body ui-body-b">
- <fieldset>
- <form name="Search" id="searchform" method="post" action="WebCatPageServer.exe">
- <input name="Action" type="hidden" value="Search"/>
- <input name="PrevSearchText" type="hidden" value="" />
- <input name="Start" type="hidden" value="1" />
- <input name="New" type="hidden" value="YES" />
- <input name="Refine" type="hidden" value="NO" />
- <label for="search-basic"></label>
- <input type="search" name="Search Term" id="search-basic" placeholder="Enter Part #'s or Keywords" tabindex="1"/>
- </form>
- </fieldset>
- </div><!-- /Search Bar -->
- </div><!-- /header -->
- <div data-role="content">
- <ul data-role="listview" data-inset="true">
- <li><a href="SPI_TOCLink" data-theme="c">Browse Products</a></li>
- <!-- SPI_HTML_ShowSearchMenu -->
- <li><a href="SPI_SearchLink" id="SPI_CurrMenuSearch" data-prefetch>SPI_SearchMenuText</a></li>
- <!-- SPI_HTML_ShowSearchMenu -->
-
- <!-- SPI_HTML_AllowKits -->
- <li><a href="SPI_KitsLink" data-theme="c" id="viewjobs" data-prefetch>View Jobs</a></li>
- <!-- SPI_HTML_AllowKits -->
- <!-- SPI_HTML_AllowOrderPlacement -->
- <li><a href="SPI_ShopingCartLink" data-theme="c" data-prefetch>Shopping Cart</a></li>
- <!-- SPI_HTML_AllowOrderPlacement -->
- <!-- SPI_HTML_AllowSales -->
- <li><a href="SPI_SalesLink" id="SPI_CurrMenuSales" data-prefetch>SPI_SalesMenuText</a></li>
- <!-- SPI_HTML_AllowSales -->
- <!-- SPI_HTML_ShowMyAccountMenu -->
- <li><a href="SPI_MyAccountLink" data-theme="c" data-prefetch>SPI_MyAccountMenuText Dashboard</a></li>
- <!-- SPI_HTML_ShowMyAccountMenu -->
- <li><a href="SPI_LogoutLink">Logout</a></li>
- </ul><!-- /listview -->
- </div><!-- /Content-->
- <div data-role="footer">
- </div><!-- /footer -->
- </div><!-- /page -->
- </body>
- </html>
2.
1. I have ajax disabled globally.
2. I'm using a single page template (multiple pages).
Thanks!