In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "is there a difference between javascript and jquery"? the content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "is there a difference between javascript and jquery"?
The operating environment of this tutorial: windows7 system, javascript1.8.5&&jquery1.10.0 version, Dell G3 computer.
First, the essential difference
1.JavaScript is a lightweight programming language that can be executed by all modern browsers by inserting tags into HTML pages.
2.JQuery is a library of JavaScript functions. Or one of the most popular frameworks in JavaScript.
The first thing to use JQuery is to add a reference to the jQuery library at the beginning of the HTML code, such as:
Library files can be placed locally, or you can directly use the CDN of well-known companies, the advantage is that the CDN of these large companies is more popular, users are likely to be cached in the browser when visiting other websites before visiting your website, so it can speed up the opening of the website. Another benefit is obvious, saving the traffic bandwidth of the site. For example:
/ / Google or: / / jQuery official II. Grammatical differences
1. Different methods of manipulating element nodes
A.JavaScript usage
GetElement series, query series
Ha heh he / / is an array, even if there is only one element, you need to use [0] to get the first one and then use document.getElementsByName ("na"); / / is an array, even if there is only one element, you need to use [0] to get the first and then use document.getElementsByTagName ("li") / / is an array, even if there is only one element, you need to use [0] to get the first one and then use document.querySelector ("# div"); / / is an element document.querySelectorAll ("# div li") / / is an array, even if there is only one element You need to fetch the first one with [0] and then use _ JavaScript: using get (index) or [index] to select the JavaScript object * $("p"). Get (0). Onclick = function () {} * $("p"). [0] .onclick = function () {} * ② JavaScript-- > JQuery: wrap the JavaScript object with $() (we find that JQuery is an array no matter how many objects it gets You can add an event directly to the entire array) * var p = document.getElementById ("p") * $(p) .click (function () {}); thank you for reading. The above is the content of "is there a difference between javascript and jquery?" after the study of this article, I believe you have a deeper understanding of the difference between javascript and jquery. The specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.