मैं एक साझा पाद लेख (उदा। Footer.html) बनाना चाहता हूं जिसका उपयोग मेरे jQuery मोबाइल एप्लिकेशन के सभी पृष्ठों द्वारा किया जा सकता है। हालांकि, बाहरी फ़ाइल से एचटीएमएल लोड करने के बाद मुझे फूटर नेविबार में शैलियों को रीफ्रेश करने के लिए jQuery प्राप्त करने का कोई तरीका नहीं मिल रहा है। विचारों के बाद बहुत सराहना की जाएगी।jQuery मोबाइल - बाहरी फ़ाइल से पाद लेख शामिल करें
Footer.html:
<div data-role="navbar" class="CSS" data-grid="d" id="footerNav">
<ul >
<li ><a href="#" id="a" data-icon="custom"><div>a</div></a></li>
<li ><a href="#" id="b" data-icon="custom"><div>b</div></a></li>
<li ><a href="#" id="c" data-icon="custom"><div>c</div></a></li>
<li ><a href="#" id="d" data-icon="custom"><div>d</div></a></li>
<li ><a href="#" id="e" data-icon="custom"><div>e</div></a></li>
</ul>
</div>
Index.html:
<div data-role="page" style="position: relative" data-theme="a" id="index">
<div data-role="header">
<div class="homebutton" onclick="location.href='default.html'">
</div>
<h1>
EVENT CALENDAR</h1>
</div>
<div data-role="content">
<p>
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.</p>
</div>
<div data-role="footer" class="CSO" data-position="fixed" id="footerDiv">
</div>
<script>
$('#index').live('pageinit', function (event, ui) {
$('#footerDiv').load('Shared/Footer.html');
[Some code to refresh the footer so it gets redrawn by Jquery Mobile]
});
</script>
अच्छा, निर्माण ट्रिगरिंग बेहतर काम करता है और हर मामले में – TecHunter
हाँ निकटतम अभी भी, सबसे अच्छा जवाब है, लेकिन बिल्कुल सही जवाब नहीं है। –