What is a JS?

소바·2022년 8월 3일
0
post-thumbnail

Why is it called Javascript ?

What does the script stand for?

script in plays

Well, just as you have scripts in plays where it tells the actors what they should do.

script in world of web development


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.

Why we use Javascript?

So let's understand how JavaScript works or why we use it to begin with.

  1. When we typing some URL into our browser and therefore sending a request to the server.

  2. 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.

  3. 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.

  1. And typically this response holds a HTML document, some HTML code our browser can now parse to create the DOM, the document object model, which basically is the parsed HTML code rendered by the browser. Now typically we don't just get back HTML code, but this code might include some styling or javascript or might reference some external JavaScript files which are then also downloaded.

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

Java vs JavaScript is their relationship?


No.

what is difference?


Main difference is that,
Javascript is an interpreted programming language whereas
Java is a compiled programming language.

profile
소바보이

0개의 댓글