I'm trying to follow this guide. I reach a problem when i try to change the HTML file when the user clicks a button.
This is my script:
<script>
window.$ = window.jQuery = WLJQ;
$("#btnPromo").click(function(){
$("#pagePort").load("pages/MainPage.html", function(){
alert("loaded!");
});
});
</script>
And this is my core HTML file (auto generated by Worklight):
<body onload="WL.Client.init({})" id="content" style="display: none;">
<!--application UI goes here-->
<div data-role="page" id="pagePort">
<div id="header" align="center">
<img src="images/logo.png">
</div>
<div data-role="content">
<div>
<input type="image" name="btnPromo" src="images/btnHotPromo.png" width="75%"/>
</div>
<div>
<input type="image" name="btnMall" src="images/btnMall.png" width="75%"/>
</div>
<div>
<input type="image" name="btnOutlet" src="images/btnOutlet.png" width="75%"/>
</div>
<div>
<input type="image" name="btnAbout" src="images/btnAbout.png" width="75%"/>
</div>
</div>
</div>
My goal is to change the #pagePort
to MainPage.html
every time the user clicks on #btnPromo
.