I created 2 pages. One is called home.html
, which links to products.html
. When I test this, I open home.html
, and follow the link to products.html
. But the javascript in products.html
doesn't work (see code below).
This is products.html
:
<div data-role="page" id="page1">
<div data-role="header">
<h1>
page1
</h1>
</div>
<div data-role="content">
Content1</div>
<div data-id="PersistentFooter" data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li><a href="#page1" class="ui-btn-active ui-state-persist">One</a></li>
<li><a href="#page2">Two</a></li>
<li><a href="#page3">Three</a></li>
</ul>
</div>
</div>
</div><!-- end page1-->
<div data-role="page" id="page2">
<div data-role="header">
<h1>
page2
</h1>
</div>
<div data-role="content">
Content2</div>
<div data-id="PersistentFooter" data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li><a href="#page1">One</a></li>
<li><a href="#page2" class="ui-btn-active ui-state-persist">Two</a></li>
<li><a href="#page3">Three</a></li>
</ul>
</div>
</div>
</div><!-- end page2-->
<div data-role="page" id="page3">
<div data-role="header">
<h1>
page3
</h1>
</div>
<div data-role="content">
Content3</div>
<div data-id="PersistentFooter" data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li><a href="#page1">One</a></li>
<li><a href="#page2">Two</a></li>
<li><a href="#page3" class="ui-btn-active ui-state-persist">Three</a></li>
</ul>
</div>
</div>
</div><!-- end page3-->
A working fiddle is now available at http://jsfiddle.net/JkYSa/, thanks to user ali-carikcioglu.
Can someone explain to me why this isn't working?