jQuery Mobile做得很漂亮,目前已经发布 1.0-beta 2了,标志可用于实际生产环境的日子也不远了。jQuery Mobile的野心非常大,它想一统移动开发,包括:android,iphone,Symbian,Blackbery,webOS。那么有否想过将其用于企业应用开发中,或者让其支持IE呢,是的,已经有人在 jQuery 的论坛中问过此事了,得到的答案是Yes。答案也比较简单,参见:https://gist.github.com/723870,一断javaScript代码,放在jQuery库和jQuery Mobile库中间:
//run this script after jQuery loads, but before jQuery Mobile loads
//customize jQuery Mobile to let IE7+ in (Mobile IE)
$(document).bind("mobileinit", function(){
$.extend( $.mobile , {
//extend gradeA qualifier to include IE7+
gradeA: function(){
//IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
var ie = (function() {
var v = 3, div = document.createElement('div'), a = div.all || [];
while (div.innerHTML = '<!--[if gt IE '+(++v)+']><br><![endif]-->', a[0]);
return v > 4 ? v : !v;
}());
//must either support media queries or be IE7+
return $.support.mediaquery || (ie && ie >= 7);
}
});
});
jQueryMobile 1.0-beta2版本即将适用于实际生产环境,它旨在统一多种移动平台的开发标准。本文介绍如何通过简单的JavaScript代码使jQueryMobile支持IE7及以上版本浏览器,为企业级应用开发提供更多可能性。
2万+

被折叠的 条评论
为什么被折叠?



