What does the script stand for?
Well, just as you have scripts in plays where it tells the actors what they should do.
the scripting languages does much the same thing with regards to web sites.
Now, in our world of web development, the script is Javascript.
And the actors are the HTML, elements, and Gwyneth would be for example, an h1 element, and Brad could be a paragraph element.
So in this case we're using our Javascript to tell our players or elements what it should do.
So let's understand how JavaScript works or why we use it to begin with.
When we typing some URL into our browser and therefore sending a request to the server.
Now, server means any kind of server running, any kind of server side language, for example, a PHP on that node, ASP.NET or all of the ruby, python and so on.
we only sent the request, but of course, we want to get back a response. So we probably receive such a response by the server.
And that's the interesting part. It includes JavaScript of some sort and JavaScript runs on the client.
where our server side language is here, run on the server and therefore are done at the point of time,we get back to response.
Whether JavaScript is still able to run once we are on that page. And that is why JavaScript is so popular these days.
Since it runs on the client, it is able to execute(= to carry out) code** without us sending a new request,** without us reloading the page so we can change to page after it has been loaded.
Some see as CSS classes might have been changed or whole new elements were added or removed to from the DOM.
And that allows us to create great user experiences. it's an important piece in building an awesome user experience because it is very reactive, very fast and very instant.
and later on we learning, by using javascript, we can creating a single page application where we only get back one page from the server and then JavaScript does everything on the front end and we only send occasional behind the scenes requests to the server.
The role of JavaScript =
building an awesome user experience &
we can creating a single page application
No.
Main difference is that,
Javascript is an interpreted programming language whereas
Java is a compiled programming language.