Welcome, everyone, to New Lecture, and today we're going to you, we're going to learn how to call
JavaScript in our application ship there to waste so we can initiate JavaScript.
One is I'm just going to show you so usually what you're going to find, but I need to explain you this,
but usually what you're going to find in the production or everywhere else, the you're going to have
here linked to a JavaScript file.
So that's called external.
External linking to a file.
And the internal linking to a file is actually here.
You're not going to be there is not going to be file here.
Everything.
The code will be right below the body.
So right below the body, you're going to first start using script.
This is how this is how you can initiate JavaScript.
So script, I'm just going to go a little bit plus like this.
Yeah.
Now, one more thing.
I always use control as to save.
So don't if you don't say you're not going to see any changes here.
Right.
So make sure that when I don't say there is a bubble here, like a white bubble and that is one.
So I know that, you know, but some of you guys still don't know this.
Now, this is called and we're going to make a comment here.
So in HTML, you can write whatever you want, for example, here in line script call and you can select
this one control and forward slash that will create a common.
And if you go here, the comment will not be visible right now.
I know that you know this, but I need to tell you.
So the next thing that you want to do is here.
So this is the script.
So how do we know that this is actually working?
So there is a one particular way to lorgnette console that log in each side.
We are passing some arguments or variables or a string.
So hello, world is pretty much you're going to find in every tutorial basic.
But if you refresh here, it's a scripting language.
It's not going to use is you're not going to be able to see it here.
This console, the clock, you will see if you go to inspect and if you go to a console.
Now, in order to see this, you need to go to the console.
Here it is.
Hello, World.
And actually, it's not visible.
Maybe mine, but it's there.
I don't know if I can just make it bigger, but I can see here on the wall is there now there is a one
more other way that you can do it.
So I'm just going to comment now.
I'm going to show you how to make a comments here in in how to say in JavaScript.
So there is a single line Commins.
So double forward slash and say, OK, this is single line comments in same as in HTML.
It's not going to be visible here.
You're not going to be able to see it.
Now if you want to make more comments like a one, two, three comments, because here if I press enter
and if you start typing, it's not considered as a comment.
So if you want to multiple comments, the other way is to do forward slash star and star forward slash.
So that means opening and closing.
See, this one is backwards and the other one here, you're making multiple comments, comments.
This is how you make.
So for example, one, this is in line script call.
Now second comments will not be visible, will not be rendered.
Now if you remember, if you refresh this, nothing will change.
So now you know how to do it.
Comments, you know how to do.
Actually, this is outside the script.
So it's a not the same comment here.
So I'm just going to I'm going to leave it like that.
So this is a single line comment.
I'm just going to make it like this.
This is a single line comment.
And this is a multiple these are multiple comments right now.
You know how to do it.
So this is the inline way of calling JavaScript.
Now, one more thing that I'm just going to create a file here and I say, OK, scripts.
That is so remember, you need to put these jazz extension in order to put it here, and I'm going to
copy this one here and I'm going to put it there.
Hello, world from external JavaScript file.
This is how the world from external.
And if I do it like this, you will not be able to see it.
Why?
Because this JavaScript file is here, but it's never been called here in the HTML.
Now how we can do it.
Remember that.
Actually, I don't have it here.
Remember that when we doing a success, we are calling a Sears's files here on top in the head so we
can do that in the below the body and we can do the same thing here.
Now, I'm just going to call scrip sirc means for source equal in I.
Need to select script, that is Eve, and you need to close it as well.
This is what I mean, because it's closed now scripts.
James is this file.
So if I save it first, I will be able to sit this in.
Then I will be able to see what's inside this file.
Now, here it is.
One more thing about the comments.
You can also use the comments to comment this part.
So control and forward slash.
And now, although this one is called first, there is nothing inside.
Actually, it's going to be printing this one.
Yeah.
One more thing in production, you're going to see folder here called Jase's sorry, in a folder here
called The Xerces.
Now, don't mind about my icons here.
I'm not going to be able to see it because I have used extensions in mine.
Extensions are pretty much here, so I'm going to show you my extensions and you can go one by one.
Download all of these extensions and material I can team.
That's why you see the icons.
So Rainbow brackets, code, stuff like that.
Now self out the closed stack.
That's why you see that this one is self-closing.
Now I use now all often.
So when you find out that, for example, debugger for Chrome, you go there and install it.
And after that maybe you need to be too close to this one and to initiate again, I mean, to close
the bioscope.
That's it.
This is my taxi.
This is my extensions that I have.
And this is the extension marketplace where you can find them.
Very cool.
Now, you professionally know a lot of things, guys, so I'm calling this one.
Make sure that you do the same thing.
And from now, what I'm going to do, I'm going to move this one into Jane's folder and it's going to
ask me.
I'm just going to say move.
So this is inside your folder.
Now, look what's happening.
So if I see loading field for the screen, the source HDTV localhost.
Right.
Genius intro script, dodgiest.
It's not there.
Why?
It's not there because before I was in the same level with index that HDMI out now it's not in the same
level.
So how we can do that so we can just skip this one.
So dot forward slash and it will give me option to go to different directories.
So if I, so I'm just going to remove this one in order to see that forward slash and you say is now
forward slash again in its finding the script inside and you put a script.
Now this one is out to I don't know, what's the name of this one either closed or out of finding.
So yeah, that's why it's finding me like this.
Yeah.
I've done have a lot of this one, but you don't need it actually.
So this is the part you want to see it.
And now if you refresh it, heal the world from external file for it from external JS here.
It's here now that's better.
So that is pretty much it now.
Your master of JavaScript.
No I'm just joking.
We just started so you know how to call inline in external JS into the project.
Very good.
Second thing that you know how to do a Commins if you do a common it's not going to be loaded even here.
So you can put a comment here and say, OK, if I can type it external jayasekara, that's pretty much
it.
Now you can make a comment in the next lecture.
We're going to do something very interesting.
So stay tuned.
Watch the previous lecture, what's the what's the next lecture and enjoy the content.
Thank you very much.
I hope you hope you enjoyed this one.
And I will see you in the next one.