DOM Selection

$('.someclass')

document.querySelector('.someclass')

document.querySlectorAll('.someclass li')

DOM Manipulation //操作 操纵

$element.remove()

$element.prepend(otherElement)

$element.before(otherElement)

$element.addClass('someClass')

$element.removeClass('someClass')

$element.toggleClass('someClass')

const parent = $element.parent()

const cloned = $element.clone()

Vanilla: //普通的

element.remove()

element.prepend(otherElement)

element.before(otherElement)

element.classList.add('someClass')

element.classList.remove('someClass')

element.classList.toggle('someClass')

element.classList.toggle('someClass')

const parent = element.parentNode

const colined = element.cloneNode(true)

element.prepend(Other)

Events

$someElement.on('click',function(e){

//Logic

});

someElement.addEventListener('click'.e=>{

//Logic

});

HTTP Requests/Ajax

jQuery was MUCH easier than using the XHR object to make ajax calls.Now we have Fetch and other specialized libraries.

fetch('http://api.something.com')

.then(res => res.json())

.then(data => console.log(data))

axios.get('http://api.something.com')

.then(res => console.log(res,data))

Utilities

$.isArray(someValue)                            Array.isArray(someValue)

$.inArray(item,anArray)                         someArray.indexOf(item) < -1

$.each(someArray,(index,value)=>{})   someArray.forEach((value,index)=>{})

$.map(someArray,(value,index)=>{})    someArray.map((value,index)=>{})

$.grep(someArray,(value,index)=>{})    someArray.filter((value,index)=>{})

$.parseJSON(str)                                    JSON.parse(str)

Animations

Animation with Vanilla JS only is one thing that is MUCH more difficult than with jQuery but there are many other options

·CSS Transitions/Keyframes

·Web Animation API

·3rd party libraries like Greensock

Not about the future but now.

Is jQuery Still Relevant in 2018?的更多相关文章

  1. Jquery动态设置下拉框selected --(2018 08/12-08/26周总结)

    1.Jquery动态根据内容设置下拉框selected 需求就是根据下拉框的值动态的设置为selected,本以为很简单,网上一大推的方法,挨着尝试了之后却发现没有一个是有用的.网上的做法如下: &l ...

  2. 2018.7.5 jQuery学习

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8&quo ...

  3. 2018.2.28 PHP中使用jQuery+Ajax实现分页查询多功能如何操作

    PHP中使用jQuery+Ajax实现分页查询多功能如何操作 1.首先做主页Ajax_pag.php 代码如下 <!DOCTYPE html> <html> <head& ...

  4. 2018.11.30 spoj220 Relevant Phrases of Annihilation(后缀数组+二分答案)

    传送门 代码: 先用特殊字符把所有字符串连接在一起. 然后二分答案将sasasa数组分组. 讨论是否存在一个组满足组内对于每一个字符串都存在两段不相交字串满足条件. #include<bits/ ...

  5. jQuery选择什么版本 1.x? 2.x? 3.x?

    类似标题:jQuery选择什么版本?jquery一般用什么版本?jquery ie8兼容版本.jquery什么版本稳定? 目前jQuery有三个大版本:1.x:兼容ie678,使用最为广泛的,官方只做 ...

  6. 解密jQuery内核 DOM操作

    jQuery针对DOM操作的插入的方法有大概10种 append.prepend.before.after.replaceWith appendTo.prependTo.insertBefore.in ...

  7. 【菜鸟学习jquery源码】数据缓存与data()

    前言 最近比较烦,深圳的工作还没着落,论文不想弄,烦.....今天看了下jquery的数据缓存的代码,参考着Aaron的源码分析,自己有点理解了,和大家分享下.以后也打算把自己的jquery的学习心得 ...

  8. 多个插件依赖不同版本jQuery问题解决案例

     <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript">< ...

  9. 转:jQuery.data

    原文地址:http://www.it165.net/pro/html/201404/11922.html 内存泄露 首先看看什么是内存泄露,这里直接拿来Aaron中的这部分来说明什么是内存泄露,内存泄 ...

随机推荐

  1. JavaScript正则表达式总结

    同学们,今天给大家带来一篇正则表达式的总结,老规矩,先说下我们为什么要用正则?正则要用在什么地方? (个人理解的,大神轻喷) 正则很多时候要用于字符串操作,比如我们要把一个字符串里面的空格删除啊,替换 ...

  2. nyoj11-奇偶数分离

    奇偶数分离 时间限制:3000 ms  |  内存限制:65535 KB 难度:1 描述 有一个整型偶数n(2<= n <=10000),你要做的是:先把1到n中的所有奇数从小到大输出,再 ...

  3. [codeforce 975C] Valhalla Siege (二分)

    Examples input 5 5 1 2 1 2 1 3 10 1 1 1 output 3 5 4 4 3 input 4 4 1 2 3 4 9 1 10 6 output 1 4 4 1 N ...

  4. LIS,LCS,LICS 学习笔记

    1.最长上升子序列(LIS) 子序列: 1.可以不连续 2.相对位置不变 dp[i][j] 表示前i位置,最大值为j的LIS长度 1. dp[i-1][j] 前i-1位置,最大值为j的LIS长度 (没 ...

  5. jQuery练习总结(二)

    --------------------------------------- <!DOCTYPE html> <!DOCTYPE HTML PUBLIC "-//W3C/ ...

  6. 使用githug游戏提高git水平

  7. Ubuntu16.04安装Caffe

    一.安装ccmake ccmake和cmake的功能是一样的,但它很方便设置编译前的一些参数,安装只需从官网下载压缩包,解压,最后将解压得到的文件夹中的bin文件夹的路径加入PATH环境变量中即可. ...

  8. 在Eclipse中创建Maven多模块项目

    在Eclipse中创建Maven多模块项目1,创建多模块项目选择File>New>Project,打开New Project窗口,选择Maven>Maven Project,选择下一 ...

  9. 从C到C++(下)

    继承 从一个类派生到另外一个类,使前者的所有特征在后者中自己主动可用. 他能够声明一些类型,这些类型能够共享部分或所有曾经所声明的类型.它也能够从超过一个的基类中共享一些特性. C++是支持多继承的. ...

  10. 菜鸟nginx源代码剖析数据结构篇(九) 内存池ngx_pool_t

    菜鸟nginx源代码剖析数据结构篇(九) 内存池ngx_pool_t Author:Echo Chen(陈斌) Email:chenb19870707@gmail.com Blog:Blog.csdn ...