gaurav gaurav - 7 months ago 13
Javascript Question

jquerymobile back button is not showing on header

I am trying to make a

mobile site in MVC
, i am new to jquerymobile, i copied the following code from JQM tutorial and paste it in a
View
in MVC

<div data-role="page" id="home">

<div data-role="header">
<h1>Home</h1>
</div>

<div data-role="content">
<p><a href="#about" data-role="button">About this app</a></p>
</div>

</div>

<div data-role="page" id="about">

<div data-role="header">
<h1>About This App</h1>
</div>

<div data-role="content">
<p>This app rocks! <a href="#home" data-role="button">Go home</a></p>
</div>

</div>


My problem is, that it shows the
back button on header in the demo
from where i copied the code but when i run this in ,
the back button is not there
can any body tell me, why this happened?

Answer

Try putting the following attibute on your "page" div:

data-add-back-btn="true"

e.g.

<div data-role="page" id="home" data-add-back-btn="true">