Wednesday, April 18, 2012

jQuery Mobile 1.1 Final released

jQuery Mobile 1.1 has been released with hundreds of improvements, big and small, to make jQuery Mobile feel faster, smoother and more polished across the board.

The most notable improvements in 1.1.0 are true fixed toolbars, completely re-vamped animated page transitions and AJAX loader, refined form element design and feature set, and improved documentation. 

Requires jQuery core 1.6.4 or 1.7.1.

Know more: http://jquerymobile.com/blog/2012/04/13/announcing-jquery-mobile-1-1-0/

Saturday, April 14, 2012

Professional jQuery


A complete, in-depth look at jQuery
If you're looking for a single resource that completely encompasses jQuery and related technologies, then look no further. This authoritative guide dives right into exploring jQuery, the leading framework used for standards-based, client-side web development. You'll discover how jQuery is structured so that it can be used to accomplish a wide range of tasks and you'll learn how to integrate jQuery into your web pages. The authors provide helpful lessons and valuable examples so that you can get a firm grasp on how best to maximize the capabilities of jQuery.
  • Begins with a look at where to access the latest version of jQuery and reviews a number of useful tools to help get started with this popular framework
  • Describes how to manipulate DOM elements, work with HTML forms, and create visual effects
  • Covers working with AJAX and JSON
  • Explains techniques for using and developing jQuery plugins
  • Details developing jQuery for mobile devices
You'll quickly see for yourself why jQuery is rapidly growing in popularity as developers are looking to build sites that are fully functional today and can handle the technologies of tomorrow.


Thursday, April 12, 2012

OpenLayers: set center of map and zoom level

Modify from last post "Example to load OSGEO map using OpenLayers"; to set center of map and zoom level, replace the code myMap.zoomToMaxExtent() by:
myMap.setCenter(new OpenLayers.LonLat(<Lon, Lat>)); 
myMap.zoomTo(<zoom level>);

Example:

set center of map and zoom level

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="utf-8" />
 <title>Mobile-Web-App</title>
 <script type="text/javascript" src="http://openlayers.org/api/2.11/OpenLayers.js"></script>
 <script type="text/javascript" >
  var myMap;
  
  function loadOpenLayers(){  
  
   myMap = new OpenLayers.Map("mymap", {});
   
   var wms = new OpenLayers.Layer.WMS(
    "OpenLayers WMS",
    "http://vmap0.tiles.osgeo.org/wms/vmap0",
    {layers: "basic"},
    {});
    
   myMap.addLayer(wms);

   myMap.setCenter(new OpenLayers.LonLat(-122.349243, 47.651743));
   myMap.zoomTo(6);   
  } 
 
 </script>
</head>
<body onload="loadOpenLayers();">
 <h1>Mobile-Web-App</h1>
 <p>Load osgeo map using OpenLayers</p>
 <div id="mymap" style="width: 250px; height: 250px; border: 1px solid;">
 </div>

</body>
</html>

Example to load OSGEO map using OpenLayers

Example to load OSGEO map using OpenLayers
<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="utf-8" />
 <title>Mobile-Web-App</title>
 <script type="text/javascript" src="http://openlayers.org/api/2.11/OpenLayers.js"></script>
 <script type="text/javascript" >
  var myMap;
  
  function loadOpenLayers(){  
  
   myMap = new OpenLayers.Map("mymap", {});
   
   var wms = new OpenLayers.Layer.WMS(
    "OpenLayers WMS",
    "http://vmap0.tiles.osgeo.org/wms/vmap0",
    {layers: "basic"},
    {});
    
   myMap.addLayer(wms);

   myMap.zoomToMaxExtent();   

  } 
 
 </script>
</head>
<body onload="loadOpenLayers();">
 <h1>Mobile-Web-App</h1>
 <p>Load osgeo map using OpenLayers</p>
 <div id="mymap" style="width: 250px; height: 250px; border: 1px solid;">
 </div>

</body>
</html>

Next: - OpenLayers: set center of map and zoom level

Wednesday, April 11, 2012

jQuery Mobile - Create List items dynamically

Refer to the another post of Create List items dynamically for normal Javascript version. We can create List items similarly. But after list items updated, have to call $("#unorderedlist").listview("refresh") to refresh in mobile style.

example:



<!doctype html>
<html>
  <head>
   <meta charset="utf-8"></meta>
   <meta name = "viewport" content = "width = device-width, height = device-height" />
   <title>Android-er</title>
   
 <link rel="stylesheet"  href="http://code.jquery.com/mobile/1.1.0-rc.2/jquery.mobile-1.1.0-rc.2.min.css" />  
 <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
 <script src="http://code.jquery.com/mobile/1.1.0-rc.2/jquery.mobile-1.1.0-rc.2.min.js"></script>

    <script >
    
    var weekdayarray = new Array ("Sunday",
          "Monday",
          "Tuesday",
          "Wednesday",
          "Thursday",
          "Friday",
          "Saturday");
          
    function onloaded(){
     var ulist = document.getElementById("unorderedlist");
     
     //Generate list items for <ul>
     for (var i = 0; i < weekdayarray.length; i++) {
      var li = document.createElement("li");
      li.innerHTML = weekdayarray[i];
      ulist.appendChild(li);
     }
     $("#unorderedlist").listview("refresh");
    }
    </script>
  </head>
  <body onload="onloaded()">
  
   <div data-role="page" id="home">
    <div data-role="header">
     <h1>Mobile-Web-App</h1>
    </div>
    
    <div data-role="content">
     <ul data-role="listview" id="unorderedlist" />
    </div>
   
    <div data-role="footer">
     <h4><a href="http://mobile-web-app.blogspot.com/">http://mobile-web-app.blogspot.com/</a></h4>
    </div>
   </div>
   
  </body>
</html>

Without $("#unorderedlist").listview("refresh"), it will look like this:



Tuesday, April 10, 2012

Sencha Touch Mobile JavaScript Framework

This book is a step-by-step tutorial aimed at beginners to Sencha Touch. There is ready sample code explained with essential screenshots for better and quicker understanding. This book is ideal for anyone who wants to gain the practical knowledge involved in using Sencha Touch mobile web application framework to make attractive web apps for mobiles. If you have some familiarity with HTML and CSS, then this book is for you. This book will give designers the skills they need to implement their ideas, and provides developers with creative inspiration through practical examples. It is assumed that you know how to use touch screens, touch events, WebKit on mobile systems, Apple iOS, and Google Android for Mobiles.

Monday, April 9, 2012

jQuery Tools UI Library

A practical tutorial with powerful yet simple projects that are quick to implement. This book is aimed at developers who have prior jQuery knowledge, but may not have any prior experience with jQuery Tools. It is possible that they may have started with the basics of jQuery Tools, but want to learn more about how it can be used, as well as get ideas for future projects.