1

00:00:02,033  -->  00:00:07,066
So let's get started with this course and with everything you need to know about Javascript by diving

2

00:00:07,066  -->  00:00:10,967
into this important question, what is Javascript?

3

00:00:10,967  -->  00:00:13,400
Let's have a look at a couple of definitions.

4

00:00:13,400  -->  00:00:20,100
Javascript is a dynamic, weakly typed programming language which is compiled at runtime.

5

00:00:20,234  -->  00:00:27,267
It can be executed as part of a web page in a browser or directly on any machine in a so-called host

6

00:00:27,267  -->  00:00:29,000
environment.

7

00:00:29,267  -->  00:00:30,767
Okay, not entirely clear yet,

8

00:00:30,801  -->  00:00:34,134
let's have a look at an additional definition.

9

00:00:34,534  -->  00:00:38,267
Javascript was created to make web pages more dynamic,

10

00:00:38,301  -->  00:00:44,268
that's kind of the idea why Javascript was invented in the past you could say, more about the history

11

00:00:44,268  -->  00:00:47,101
of Javascript in a second by the way.

12

00:00:47,568  -->  00:00:53,468
So it was invented to change the content on a page directly from inside the browser

13

00:00:53,568  -->  00:00:59,968
and originally, it was called LiveScript but due to the popularity of Java back at the time, it was renamed

14

00:00:59,968  -->  00:01:04,402
to Javascript to resemble Java by its name.

15

00:01:04,602  -->  00:01:06,968
Javascript however is totally independent from Java,

16

00:01:06,968  -->  00:01:09,635
that's important to understand and has nothing in common,

17

00:01:09,635  -->  00:01:17,302
it really was just named Javascript because Java was popular and people who invented Javascript

18

00:01:17,302  -->  00:01:23,969
wanted Javascript to be a thing I guess but I'm not sure, are these definitions really clear?

19

00:01:23,969  -->  00:01:26,136
Do you now know what Javascript is?

20

00:01:26,169  -->  00:01:32,369
Does dynamic, weakly typed compiled at runtime make web pages more dynamic?

21

00:01:32,369  -->  00:01:34,536
Does this tell you something?

22

00:01:34,536  -->  00:01:36,836
Well let's take a step back maybe,

23

00:01:36,903  -->  00:01:45,503
how do web pages work? You are the user visiting a web page and when you do visit a web page, you use

24

00:01:45,570  -->  00:01:52,203
browser for that. You use your client, your machine, your laptop, your computer, where you have a browser

25

00:01:52,203  -->  00:01:53,403
installed on it,

26

00:01:53,537  -->  00:01:59,603
you enter a URL or click on a search result on Google and the web page gets loaded,

27

00:01:59,603  -->  00:02:05,937
To be precise when you initially visit a web page, a request is sent to the server,

28

00:02:05,937  -->  00:02:13,037
so to a computer in the Internet where that web page, where the HTML file is hosted and that server

29

00:02:13,037  -->  00:02:21,504
then loads that web page and sends it back to your browser in a so-called response and the most basic

30

00:02:21,504  -->  00:02:27,038
form of response we know or we typically see and use when we work with the Internet,

31

00:02:27,038  -->  00:02:35,538
when we visit a page is simply an HTML page which is sent back by the server to the client.

32

00:02:35,538  -->  00:02:39,638
Now let's say on that loaded web page, let's say it's an online shop,

33

00:02:39,638  -->  00:02:41,038
doesn't really matter,

34

00:02:41,038  -->  00:02:47,772
the user clicks a button to submit a form, for example to order some products.

35

00:02:47,905  -->  00:02:54,972
Now this will then trigger a new request which is sent by the browser to the server to send this form

36

00:02:54,972  -->  00:02:59,805
submission to the server and the server will handle the incoming request,

37

00:02:59,839  -->  00:03:08,572
maybe store some order data in a database and once it's done, it will reply back with a new response,

38

00:03:08,739  -->  00:03:16,073
with a new web page, a new HTML document which is sent back to the client, maybe the order confirmation

39

00:03:16,073  -->  00:03:20,940
page. So this is how we interact with the web,

40

00:03:20,940  -->  00:03:24,173
this is how web pages traditionally work.

41

00:03:24,473  -->  00:03:28,773
Now Javascript helps us make this more reactive,

42

00:03:28,773  -->  00:03:37,940
it helps us make a web page more reactive and skip that second request response flow in some circumstances

43

00:03:38,273  -->  00:03:43,807
to instead change the already loaded page and do something there.
