Removing Back Button on jQuery Mobile

by Pete Freitag

When building native apps with jQuery Mobile I often find that the back button is not needed in the header toolbar. There is a quick and easy way to disable it by adding data-backbtn="false" to your header:

<div data-role="header" data-backbtn="false">
  <h1>Mileage Pad</h1>
</div>

Comments

Steve

Ahh! Thank you! I was kicking around this issue just yesterday. I thought there must be an easy way to do it. You have saved me some painful searching and a lot of trial and error! Many thanks!

Steve

Odd... its not working for me. But I change the attribute to this and it did work: data-nobackbtn="true"

Pete Freitag

Steve what version of jQuery Mobile are you using Alpha 2 or Alpha3 (from git repo)

Steve

Alpha 2... that was the latest I saw online earlier this week. I'll take another look... maybe I missed a newer version.

Pete Freitag

Alpha 3 has not been released yet but you can download it from their git repository.

Pete Freitag

Right I probably shouldn't call it alpha 3 since it has not been released yet, but if you download the latest source from git that's what I'm talking about.

Steve

I only see a2, even on Github.

Raymond Camden

I'm working my way through the docs in preparation for my SOTR preso. One thing I wish they would do is create a list of _all_ the data attributes along with where they can be used and what they do. I may end up doing that myself.

Pete Freitag

Yeah I agree, I always prefer a straight up reference over docs embedded in prose.

Sundar

data-nobackbtn="true" attribute works for me with latest JQuery mobile 1.0a4.1

Kacy

That's a sensible answer to a chgnielalng question