Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Mobile - Include Footer from External File
    primarykey
    data
    text
    <p>I would like to create a shared footer (e.g. footer.html) that can be used by all of the pages in my jQuery Mobile application. However, I cannot find a way to get jQuery to refresh the styles in the footer navbar after loading the html from the external file. After thoughts would be greatly appreciated.</p> <p>Footer.html:</p> <pre><code>&lt;div data-role="navbar" class="CSS" data-grid="d" id="footerNav"&gt; &lt;ul &gt; &lt;li &gt;&lt;a href="#" id="a" data-icon="custom"&gt;&lt;div&gt;a&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;li &gt;&lt;a href="#" id="b" data-icon="custom"&gt;&lt;div&gt;b&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;li &gt;&lt;a href="#" id="c" data-icon="custom"&gt;&lt;div&gt;c&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;li &gt;&lt;a href="#" id="d" data-icon="custom"&gt;&lt;div&gt;d&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;li &gt;&lt;a href="#" id="e" data-icon="custom"&gt;&lt;div&gt;e&lt;/div&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>Index.html:</p> <pre><code>&lt;div data-role="page" style="position: relative" data-theme="a" id="index"&gt; &lt;div data-role="header"&gt; &lt;div class="homebutton" onclick="location.href='default.html'"&gt; &amp;nbsp;&lt;/div&gt; &lt;h1&gt; EVENT CALENDAR&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;p&gt; This is a single page boilerplate template that you can copy to build you first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.&lt;/p&gt; &lt;/div&gt; &lt;div data-role="footer" class="CSO" data-position="fixed" id="footerDiv"&gt; &lt;/div&gt; &lt;script&gt; $('#index').live('pageinit', function (event, ui) { $('#footerDiv').load('Shared/Footer.html'); [Some code to refresh the footer so it gets redrawn by Jquery Mobile] }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload