The difference between JS and jQuery
来源:互联网 发布:索尼 网络授权经销商 编辑:程序博客网 时间:2024/05/29 15:08
See as https://blog.udemy.com/jquery-vs-javascript/
JQuery vs. JavaScript: What’s the Difference Anyway?
Many aspiring web developers want to know what the differences between JavaScript and jQuery actually are. After all, they both start with a J, but are there other similarities as well? It may surprise you to learn that JavaScript and jQuery are actually the same thing. In a nutshell, jQuery is a set of JavaScript libraries that have been designed specifically to simplify HTML document traversing, animation, event handling, and Ajax interactions.
That said, in order to use either one of these scripting languages you need a solid foundation in JavaScript. If you are unfamiliar with using JavaScript for web development, check out JavaScript Made Easy. Once you understand how to use JavaScript, you might find that jQuery meets most of your needs and requires much less coding than conventional JavaScript might require.
In this article, you will learn what JavaScript is, what jQuery is, and which scripting language is the better choice for your future web development projects.
What is JavaScript?
JavaScript is a scripting language that was designed for use within a web browser. Typically, JavaScript is used for interface interactions. Slideshows and other interactive components are typically done using JavaScript.JavaScript has many other uses as well. If you are familiar with using the Google email client Gmail, you have experienced the power of JavaScript firsthand. Many of the additional features and functionalities that make Gmail such a popular email solution are created using JavaScript.
The uses of JavaScript don’t stop there, however. JavaScript has also been used for server-side programming, game development, and even creating desktop applications.
Years ago, JavaScript was popular but web developers were not entirely sold on the idea of using it simply because every web browser would render JavaScript content in a different manner. Newer standards now force all web browsers to implement JavaScript uniformly; saving developers time and frustration trying to debug code for a specific web browsing client.
Dynamic content is the hot topic in web development right now. Dynamic content refers to content that constantly changes and adapts to specific users whenever possible. For example, JavaScript can be used to determine if a website visitor is using a computer or a mobile device before deciding whether or not to render the mobile version of the website. It’s these small things behind the scenes that create genuine value in using JavaScript to create dynamic web pages.
What is jQuery?
So Which One Should You Use?
jQuery
$ (‘body’) .css (‘background’, ‘#ccc’);
JavaScript
Function changeBachground(color) { Document.body.style.background = color;}Onload=”changeBackground (‘red’);”
Can you see how in a large, complex web development project it makes more sense to use jQuery? A single line of code accomplishes what it takes four lines of code to accomplish in JavaScript and this doesn’t even account for the extra time you might spend debugging this short piece of code to work across popular web browsers including Internet Explorer, Firefox, Chrome, and Safari.
- The difference between JS and jQuery
- The difference between JQuery and JQuery.fn
- The difference between (()) and ().
- The Difference Between jQuery’s .bind(), .live(), and .delegate()
- the difference between "./" and "sh"
- JS advice: Be careful the difference between Undefined and ‘ ’
- the difference between the SOURCELIBS and TARGETLIBS
- The difference between Const and ReadOnly
- The difference between Failure and Success
- The difference between Process and Procedure
- The difference between GetDC and GetWindowDC
- The difference between Chinese and American
- The difference between J2ee and Ruby
- The difference between SendMessage and PostMessage
- The difference between lint and gcc
- The difference between sizeof and strlen
- The Difference Between Internet, Intranet, and Extranet
- The difference between CLOCK_MONOTONIC and CLOCK_REALTIME
- 结构体中的 char *name & char name[20]
- Memory : Stack vs Heap
- 黑马程序员_IO流(对象的序列化和反序列化)
- 事件篮方法 - 如何管理好自己的时间
- 黑马程序员_IO流(RandomAccessFile)
- The difference between JS and jQuery
- C++中while(std::cin >> value)的思考
- foo
- C语言结构体的对齐原则
- 结构体的数组成员变量对齐
- spring重装
- ES6学习——新的语法:Symbols——Symbol.iterator
- 五种开源协议的比较(BSD,Apache,GPL,LGPL,MIT)
- 【NOI2015】小园丁与老司机 DP 网络流