Some js file and social media plugin did not load when changing pages using jQuery Mobile Sliding Panel

33 views Asked by At

I am using jQuery Mobile's panel feature to navigate between pages. Most of my pages have some jssor plugin and social media plugins like Facebook and Twitter. The plug ins do not work through the panel item when selected.

This is my current page: http://191armyband.com/contact.html

I clicked menu and go to home page, the home page should load Twitter feeds, Facebook plug in and a jssor plugin. All these do not work if I navigate here from the panel.

I am assuming if I turn off the AJAX feature from jQuery Mobile, I might make this work...

$.mobile.ajaxEnabled = false;

Is this the correct code to use? How should I integrate it in my code?

Here is the code of my current page: http://jsfiddle.net/humorean/n7x4mv9k/

1

There are 1 answers

1
Wisely Wong On BEST ANSWER

Try put the stop AJAX script right before your jQuery Mobile js:

<script type="text/javascript"> $(document).bind("mobileinit", function () { $.mobile.ajaxEnabled = false; }); </script> <script src="js/jquery.mobile-1.4.5.min.js"></script>

Put this script in all the landing pages for all pages to work with the plugins.