Using JQuery Mobile and JSON to Create Mobile Applications

随着组织寻求增强其产品的移动存在感,移动应用开发成为焦点。jQuery Mobile (JQM) 作为适应移动设备的框架,提供了简洁的开发方式,支持渐进增强及优雅降级,并且具备良好的可访问性。通过 AJAX 技术改进了用户体验,同时 JQM 的大小也被压缩以适应移动环境的需求。

Mobile Application Development is rapidly becoming a major focus for most organizations which seek to add a mobile presence or "touch point" to existing products and applications. Most if not all mobile application development frameworks have been adapted one way or another from an existing "desktop" development platform. Web based frameworks are no different. JQuery is currently being adapted to build mobile web applications (JQuery Mobile Alpha 3 was released last month).

One of the main issues in the mobile world, beyond support for device specific attributes, is size as Aaron Quint explained:

jQuery compressed even is like 40-50 K, maybe a little more than that, plus if you want jQuery UI and some of the animation stuff, that's like another 100 K. For mobile, it's not quite there yet.

JQM Alpha 3 is now down to 17k, plus the corresponding CSS.

Enrique Ortiz sees other advantages to JQM:

  • General simplicity: you can develop pages mainly using markup driven with minimal or no JavaScript.
  • Progressive enhancement and graceful degradation: jQuery Mobile philosophy is to support both high-end and less capable devices, such as those without JavaScript support, and still provide the best possible experience.
  • Accessibility: jQuery has support for Accessible Rich Internet Applications (WAI-ARIA) to help make web pages accessible for visitors with disabilities using assistive technologies.
  • Small size
  • Theming

 Installing JQM is as simple as adding a one stylesheet and three JavaScript files:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1 /jquery.mobile-1.0a1.min.css" />
<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"> </script>
<script src="http://jquery.ibm.navitend.com/utils.js"></script>

In addition, Frank explains that one of the key benefit of JQM in the Mobile world is its ability to use AJAX to smooth the user interface:

JQM takes Ajax to the next level by intercepting page requests and in most cases converting those requests to specialized Ajax calls. The net result is that as a visitor navigates a web application constructed with JQM, the DOM of the page is manipulated rather than each page being replaced at every turn.

This is achieved by the use of the HTML5 data-* attribute. In HTML5, any attribute with a prefix of data- is essentially ignored by the validating parser, and the application is free to interpret those attributes at will. JQM relies on the data-role attribute for stringing together its core functionality.

When a JQM application switches from one page to the next, the primary activity that takes place is that the content div is swapped out for the new page's content.

The data-rel attribute is used to request how the new window should appear when it is shown and the data-transition tells JQM to make the transition. The data-filter attribute is used to specify the behavior of a list data-role which can display a filtered list of value based on some keyword input. Frank also explains how to create customer data-* attributes to implement application specific attributes.

JQM will ship in the first half of this year. Frank concludes:

Over time, look for it to be incorporated into frameworks such as PhoneGap and possibly even alternative development environments such as Appcelerator's Titanium.

Do you think Web based Mobile Applications have a future? Is only a question of framework and simplicity of development or could it be that mobile applications are specific enough (as users bring their client with them and expect the highest level of user experience and security) that Web based applications will remain marginal on this new platform?

转载于:https://www.cnblogs.com/mengheyun/archive/2011/03/09/1978301.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值