Table of Contents
- 6 Conclusion
Every programming language has more and less value. Actually, the main thing is not the excess and lack of a programming language, but how we understand and apply a programming language properly.
- Does not require a compiler because a web browser automatically interprets it with HTML.
- Easy to learn.
- JS can be used in many browsers and platforms.
- Making web pages more informative.
- Easy to find plugins or additional components to speed up application development.
- Many tutorials have been shared free of charge
- High risk of exploitation.
- Can be used to activate the malicious code on the user’s computer.
- Can be rendered differently on each device which causes inconsistencies.
- Web Browsers (Google Chrome, Mozilla Firefox, Opera, etc.)
- Text Editor (Sublimetext, VS Code, Atom, notepad ++)
Every browser has a console that aims to check for errors that occur on web pages. For example, Chrome by pressing the F12 key or right-clicking on the browser and selecting the Inspect Element menu display the console window. See the picture below.
Console window function in the browser
Create a hello world
Open your favorite text editor, and copy the following code:
Save the code above with the name index1.html and run it on your favorite browser. Don’t forget to press F12 to see the console window to display the word “Hello World” in the console window.
To display on a web page, we can add the following code under console.log().
There are still some more ways that we need to know:
For example: click event.
A brief description:
The onClick attribute is an HTML attribute to declare a function that will be executed when the element clicked.
In the example above, we run the alert() function. Alert() is a function for displaying dialogs.
The contents of the hello-world.js file:
alert("Hello World from External!");
Fill in the index2.html file:
<!--Insert external js code -->
Run on the browser and the results as shown below
Other article: Tutorial Simple CRUD Angular 5 And Lumen 5.6 For Beginners