jQuery mobile 1.4.2: how to disable $.mobile.pushStateEnabled in jquery mobile 1.4.2

Hello Experts,

how do I disable $.mobile.pushStateEnabled in jquery mobile 1.4.2?

Regards,
epifanio67Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Add immediately after the jQuery Mobile script i.e. before any other code is implemented

$.mobile.pushStateEnabled = false
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SammyCommented:
I am going to have to disagree with Gary on this, the proper way to disable pushstate is to set it to false within the the global configuration (in the document mobileinit event)

$(document).bind("mobileinit", function(){
  $.mobile.pushStateEnabled = false;
});
see the documentation here http://api.jquerymobile.com/global-config/
Note that the event is called before jquery mobile is loaded.

Good luck
0
GaryCommented:
You can always disagree with me when I am wrong.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

epifanio67Author Commented:
Thank you Sammy, Gary for your help....

I read the docs; but find it confusing (different versions)...

is this the correct way to do it?
<link rel="stylesheet" href="./views/head/css/custom.css" />
<link rel="stylesheet" href="./views/head/css/jquery.mobile.icons.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile.structure-1.4.2.min.css" />
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
$(document).bind("mobileinit", function(){
  $.mobile.pushStateEnabled = false;
});
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>

Open in new window


Regards,
0
SammyCommented:
Yes,
Because jQM depends on jQuery, jQuery has to load first then jQM

Sammy
0
SammyCommented:
I believe both of OP's questions were answered correctly with an example.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.