Satch3000
Satch3000

Reputation: 49414

jquery-mobile still "No Back Button" (Beta 2)

I have followed all the instructions to get the back button to appear but it's not working.

Here is what I'm following:

*The auto-generated Back button feature is off by default. To activate auto generated back buttons on specific pages, simply add the data-add-back-btn="true" attribute on the page container and the magic will be back. To activate this globally, set the addBackBtn option in the page plugin to true. Here is an example of how to set this:

 $(document).bind("mobileinit", function() {
          $.mobile.page.prototype.options.addBackBtn = true;
     });

Note: You must include this script before the jQuery Mobile library is referenced in the head of your page for this to work. The mobileinit event is triggered immediately upon execution, so you need to bind event handlers before jQuery Mobile is loaded. Learn more about setting global config options.*

I've also cleared the cache and I still don't get the back button...

I'm I missing something new?

Upvotes: 3

Views: 1612

Answers (1)

Satch3000
Satch3000

Reputation: 49414

OK I found the solution.

I've decided to post it here for anyone who might have the same problem.

The code must be instead in a specific order.

After the jquery library but before the jqm library...

Make sure that this snippet is AFTER jQuery library loads but BEFORE jQueryMobile library is loaded... so:

<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
 $(document).bind("mobileinit", function() {
   $.mobile.page.prototype.options.addBackBtn = true;
  });
</script>
<script type="text/javascript" src="jquery.mobile-1.0b1.js"></script>

Solution found here:

http://forum.jquery.com/topic/i-need-back-button-back

Upvotes: 6

Related Questions