jMobile - Mobile JavaScript
The jMobile library was created as a much lighter and faster jQuery, built specifically for mobile devices. Which means it has a drastically smaller file size (6.8kb minified & gzipped) as compared to jQuery (23kb minified & gzipped).
In addition to core jQuery functionality, jMobile implements geolocation through HTML5 as well with full callback support.
Methods marked with * are only partially implemented.
- $.select(selector, context), $.select(element), $.select(array)
- add
- each
- attr
- removeAttr
- get
- toArray
- data
- append
- appendTo
- prepend
- prependTo
- before
- insertBefore
- after
- insertAfter
- toggle
- hide
- show
- fadeIn and fadeOut - does so without animation*
- eq
- first
- last
- indexOf
- slice
- find*
- not*
- filter*
- is*
- remove
- closest
- val* - does not do checkbox, select, etc.
- html
- text
- empty
- addClass
- removeClass
- hasClass
- parent
- parents
- parentsUntil
- next
- prev
- nextAll
- nextUntil
- prevUntil
- siblings
- children
- contents
- serializeArray
- detect
- $$ - querySelectorAll or query engine shim
- $.each
- $._each - Underscore's native each
- $._indexOf - Underscore's indexOf
- $._defaults - Underscore's defaults
- $._filter - Underscore's filter
- $.Expr - :hidden :visible now supported, can plugin other expressions as needed.
- $.filter
- $.dir
- $.nth
- $.sibling
- $.grep
- $.map
- $.data
- $.attrs
- $.trim
- $.isFunction
- $.isArray
- $.isWindow
- $.isNaN
- $.merge
- $.extend
- $.makeArray
- $.hasClass
- $.typeOf - safe type of a variable
- $.loadScript - (url, callback [, async]) load an external script dynamically
- $.loadAsync - load js async and call
$(callback)
or$.scriptsLoaded
when all scripts have been loaded - $.scriptsLoaded - register callbacks to be fired when all async scripts have been loaded.
- $.htmlFrag - creates a document fragment from a html string (name changed)
- $.walk - traveres all childElems including self
(predicateFn, [[, context], results])
- $.query - query Engine i.r. doc.querySelector || queryEngine Shim
- $.attrs - an elements attributes
- $.unique - return a unique list of elements in document order
- $.contains - parent element contains sibling
Pull requests are welcome!
Areas of interest are bug testing this library on mobile devices and integrating core browser functionality, most importantly from HTML5.
- @odmarkj (Joshua Odmark)
This library is based off of jquip, which is based off of jQuery.
The main differentiation is converting the main variable into an object so that it may be extended with core functionality, for example, HTML5's geolocation.