Yaj.js - Yet Another jQuery Replacement

Build Status Opensource ByJG GitHub source GitHub license GitHub release

Basic usage

The Yaj library like jQuery and Zepto exposes the "yo" instead "$".

"yo" requires a selector and all methods are based on the element (or elements) returned.

yo('selector').addClass('my-class');

The selector can be all valid HTML5 selector:

You can call more than one method in sequence:

yo('selector').removeClass('oneclass').addClass('otherclass');

Lightweight

Yaj is also lightweigth. Yaj have less than 18kb uncompressed, 8kb minified and 3kb minified and gzipped.

Installation

Yarn or NPM

yarn add yaj

or

npm i yaj

and then:

<script src="node_modules/yaj/yaj.min.js" />

CDN JSDELIVR

Latest version

<script src="https://cdn.jsdelivr.net/npm/yaj@1/yaj.min.js" />

Specific version

<script src="https://cdn.jsdelivr.net/npm/yaj@1.0.3/yaj.min.js" />

CDN UNPKG

Latest version

<script src="https://unpkg.com/yaj/yaj.min.js" />

Specific version

<script src="https://unpkg.com/yaj@1.0.1/yaj.min.js" />

Yo Events

Yo Dom Manipulation Reference

Yo Ajax Reference

Yo Polyfill replacement

Yaj creates polyfill replacement for important DOM implementations like:

If you add the yaj.js or yaj.min.js to your page, you can instantly use this implementations. The code below will work in the most modern broswers but also in browsers like IE8 and even IE7.

<head>
    <script src="yaj.js"></script>
</head>

<script>
localStorage.setItem('key', 'value');
console.log(localStorage.getItem('key'));
</script>

Yo Polyfill Utilities functions

Yaj is FAST

Yaj is faster than JQuery. See here the benchmark tests

FAQ

Click here