xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

no need jQuery anymore & You don't need jQuery anymore!

no need jQuery anymore & You don't need jQuery anymore!


"use strict";

/**
 *
 * @author xgqfrms
 * @license MIT
 * @copyright xgqfrms 20180101 - forever
 *
 * @description no-need-jquery & You don't need jQuery anymore!
 * @augments
 * @example
 *
 */

var $ = $ || {};
// const $ = {};

$.DOM_queryAll = ((str = `[data-sortable-box*="sortable-box"]`, debug = false) => {
    let results = document.querySelectorAll(str);
    // let results = [...document.querySelectorAll(str)];
    if (debug) {
        if (results) {
            console.log(`result = `, results);
        }else{
            console.log(`Error: result = `, results);
        }
    }
    return results ? results : ``;
});

$.DOM_query = ((str = `[data-sortable-box*="sortable-box"]`, debug = false) => {
    let result = document.querySelector(str);
    // let result = [...document.querySelector(str)];
    if (debug) {
        if (result) {
            console.log(`result = `, result);
        }else{
            console.log(`Error: result = `, result);
        }
    }
    return result ? result : ``;
});

export default $;

const DOM_queryAll = $.DOM_queryAll;
const DOM_query = $.DOM_query;

export {
    DOM_query,
    DOM_queryAll,
    DOM_query as $qs,
    DOM_queryAll as $qsa
};


/*

// import $ from "jquery";

import {$qsa, $qs} from "../utils/no-need-jquery";

import { $qsa, $qs } from "../utils/no-need-jquery";

import {
    $qsa,
    $qs
} from "../utils/no-need-jquery";


import {
    DOM_query,
    DOM_queryAll,
} from "../utils/no-need-jquery";


import {
    DOM_query,
    DOM_queryAll,
    $qs,
    $qsa
} from "../utils/no-need-jquery";

*/


refs

no need jQuery anymore

http://www.ruanyifeng.com/blog/2013/05/jquery-free.html

https://mathiasbynens.be/demo/jquery-size



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2018-06-21 19:35  xgqfrms  阅读(76)  评论(1编辑  收藏  举报