Using jQuery Mobile with Django: During the page transitions, the base scripts seems to be loading fine, but going from one page to the next, new page's scripts under the header do not load up in the browser.
To be more specific:
I know that jquery mobile tries to implement page transitions using ajax, but I am hoping I can keep the scripts in header/footer. I would hate to have to put the scripts under <div data-role="page" >
jQuery Mobile is no longer supported.
jQuery Mobile CDN: The viewport <meta> tag inside the <head> element specifies how the browser should control the page zoom level and dimensions.
The framework allows developers to build applications that can be accessed by the widest number of browsers and devices, whether it is Internet Explorer 6 or the newest Android or iPhone. Mobile jQuery also gives developers the ability to render basic content (as built) on basic devices.
jQuery load() Method The load() method loads data from a server and puts the returned data into the selected element. Syntax: $(selector).load(URL,data,callback); The required URL parameter specifies the URL you wish to load.
That is because jQuery Mobile loads only the code within the first data-role="page"
element in the DOM.
There are a couple of options you can choose from on how to fix this:
data-role="page"
element, so it will be loaded when jQuery Mobile loads the page via AJAX.I'm sure there are other methods as well but here are a couple I've had work for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With