tinyjquery
v1.0.1
Published
A Web Front Library imitated from jQuery, based on ecmascript 2015, supported IE10 and above.
Downloads
3
Readme
Description
A Web Front Library imitated from jQuery, based on ecmascript 2015, supported IE9 and above.
Use
- insert into head tag
<script src='//raw.githubusercontent.com/bougieL/tinyJquery/master/dist/js/tinyJquery.min.js'></script>
or
import
in commonJs
npm i tinyjquery -S
import $ from 'tinyjquery'
Characteristics
- Batch operation
Change all divisions' background color:
$('div').css({background: 'green'})
- Chain operation
Execute another operation directly after an operation:
$('div').css({background: 'green'}).ac('green-box')
- Callback ajax supported IE9 and above
$.ajax({ url: '/api/myUrl', method: 'get', success: function(data) { console.log(data) }, error: function(err) { console.error(err) } })
Method
Use $('cssSelector')
or $(nativeDomObject)
or $(nativeDomObjectArray)
or $(arrayLikeObject)
to generate a TinyJquery
obejct.
For example:
$('div')
, $('.box')
, $('#target')
, $(document.getElementById('#target'))
, $(document.getElementsByClassName('box'))
, $(document.querySelectorAll('.box'))
...