Reputation: 841
I am brand new to jQuery.
Looking at jQuery for the first time, it seems to replace DOM Scripting and act as a helper for DOM Scripting rather than actual JavaScript.
Yet everyone speaks about jQuery being a helper library for JavaScript.
This brought me to my question, is DOM Scripting and JavaScript one and the same thing?
Meaning that although jQuery seems to be more of a library for DOM Scripting, DOM Scripting is JavaScript!
Any help understanding this is greatly appreciated!
NOTE: The question is genuine so instead of down voting, edit and help others like me, new to jQuery , benefit!
EDIT: I think my confusion here is thinking of 'DOM Scripting' as its own separate language.
Actually it is not its own separate language, just the JavaScript language 'talking' to the DOM.
jQuery is then a helper library for JavaScript including helping with 'talking' to the DOM.
Link to MDN: https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction
see paragraph
DOM and JAVASCRIPT
Upvotes: 1
Views: 97
Reputation: 364
The HTML DOM (Document Object Model) is the object representation of your HTML. The HTML is represented under the form of a tree. Like that for example :
body
|
div
__|__
| |
p div
A 'Dom Scripting language' is a language that is able to understand the DOM structure and manipulate it. Since HTML is basically a markup language, the same as XML. And you can in most of the language find some lib that can read markup languages and HTML (or write one).
Java script is a language that is able to manipulate the DOM structure. But you can do many other thing with that. For example you can write servers with JS ( through NodeJS). You can also use it to script in various softwares as such as Adobe Reader.
JQuery is a library for JS, it allows to manipulate the HTML DOM easier and (apparently) faster. But it is not only dedicated to DOM manipulation. It also provide an AJAX API.
So to answer your question : No JS and DOM scripting are not the same thing. And Jquery is a JS library that focus principally on DOM manipulation but is not narrowed to that.
Upvotes: 1
Reputation: 2294
I would say it is not the same thing as DOM can be manipulated, theoretically, with other scripting languages too, as vbscript
. But I am sure javascript
is the most popular these days.
jQuery
is just one of the tens(hundreds?) of frameworks written in javascript
.
Upvotes: 0