Skip to main content

Posts

Showing posts with the label Ajax transitions

jQuery Mobile Page Transitions with data-ajax=false

In my earlier post here , I outlined the various page transitions that are available in jQuery Mobile.  In single-page template documents, jQM uses Ajax to smoothly transition between pages and when not possible, the framework does a simple HTTP request to pull in the page. Situations where Ajax transitions are not used are: When a page loaded is: from an external domain data-ajax="false" attribute is used rel="external" is specified target attribute is specified This is also well documented  (with examples) . In multi-page template documents, jQM needs Ajax to transition between the multiple page containers. Now lets play with this a bit. Let us try to override this with the data-ajax attribute and see what happens. Consider below code, you can click on the link below to launch it in a separate browser tab: Launch <!DOCTYPE html> <html>   <head>     <title>jQuery Mobile Transitions Demo with data-ajax="false"

jQuery Mobile data-title behavior with multi-page template

The jQuery Mobile library comes with wonderful Ajax page transition capabilities. But you have to keep a look on the Page title as you navigate between the various pages and I have tried to document the behavior under different scenarios in this blog. Consider the below code, click the below link to launch the code in a separate window. Launch <!DOCTYPE html> <html>   <head>     <title>Main Page</title>     <meta name="viewport" content="width=device-width, initial-scale=1">     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />      <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>     <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>   </head>   <body>     <div id="page1" data-role="page" data-title="p