1.0.1 • Published 7 years ago
tinyjquery v1.0.1
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
importin commonJs
npm i tinyjquery -Simport $ 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'))...