📜  jQuery vs JavaScript

📅  最后修改于: 2020-10-27 01:24:30             🧑  作者: Mango

jQuery与JavaScript

什么是jQuery

一个免费且开源的javascript库,主要用于设计,遍历和操作HTML DOM。 DOM是用于表示网页元素的树状结构。 jQuery帮助设计人员轻松地将JavaScript代码用于其网站。 jQuery的高级方法可以创建功能强大的动态网页和Web应用程序。 jQuery的语法旨在使事情变得容易,例如:

  • 浏览文件
  • DOM元素的选择
  • 创建动画
  • 处理事件
  • 开发Ajax应用程序。

jQuery是拥有以下核心功能的所有其他库中被广泛使用的javascript库之一:

  • DOM元素选择
  • Sizzle(选择器引擎)启用的遍历和操纵
  • 创建新的编程风格
  • 融合DOM数据结构和算法

另一方面,jQuery允许开发人员在JavaScript库的顶部创建插件。开发人员甚至还可以为低级交互和动画创建抽象。

jQuery与JavaScript

尽管jQuery是JavaScript的一部分,但它们之间可能存在以下某些差异:

jQuery JavaScript
It is a javascript library. It is a dynamic and interpreted web-development programming language.
The user only need to write the required jQuery code The user needs to write the complete js code
It is less time-consuming. It is more time consuming as the whole script is written.
There is no requirement for handling multi-browser compatibility issues. Developers develop their own code for handling multi-browser compatibility.
It is required to include the URL of the jQuery library in the header of the page. JavaScript is supportable on every browser. Any additional plugin need not to be included.
It depends on the JavaScript as it is a library of js. jQuery is a part of javascript. Thus, the js code may or may not depend on jQuery.
It contains only a few lines of code. The code can be complicated, as well as long.
It is quite an easy, simple, and fast approach. It is a weakly typed programming approach.
jQuery is an optimized technique for web designing. JavaScript is one of the popular web designing programming languages for developers that introduced jQuery.
jQuery creates DOM faster. JavaScript is slow in creating DOM.