1.0.1 • Published 6 years ago

tinyjquery v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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

  1. Batch operation Change all divisions' background color:
    $('div').css({background: 'green'})
  2. Chain operation Execute another operation directly after an operation:
    $('div').css({background: 'green'}).ac('green-box')
  3. 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'))...