JavaScript is the programming language of HTML and the Web. It makes the web pages dynamic. It is an interpreted programming language with object-oriented capabilities. JavaScript is also known as client-side language. This is the client site language itself. But some people also call it server site language.
The meaning of the client site which is accessed by the user is called client site language. And what runs in the server is called the server-side language.
JaveScript History
- JavaScript was introduced in 1995 by Netscape. And it was developed by Brendan Eich.
- It was first named Mocha.
- After that its name was changed to Livescript.
- Then javascript.
- Then it came to be called Ekamscript. But still people call it JavaScript only.
- There is a 5,6 version of Ekscript. May have come in 2009.
Tools
- Notepad
- Notepad++
- Any Text Editor
JavaScrips and Java Same?
No, Only java has similarities in JavaScript and java, apart from this there are no similarities in it.
Java programming language was very popular when Javascripts was being launched in the market, so they merged java with them, and then it was named JavaScript.
Advantage of JavaScript
- Client Side execution
- Velidation on Browser
- easy language
Disadvantage of JavaScript
- Less Secure
- No Hardware Access
Why of adding JavaScript
Here too, if you want to use JavaScript, then you have to link both the files through your HTML. And it has its own different rules.
- Inline
-Inside head tag
-inside body tag
- External file
-Inside head Tag
-Inside body Tag
Inline
You can write inline in 2 ways, inline and external.
Inside head Tag –
<html>
<head><title>Hello JS</title>
<script type="text/javascript">
document.write("Hello DevOpSchool");
</script>
</head>
</body>
` <h1>I am heading</h1>
<p>I am Paraghraph</p>
</body>
</html>
Inside body tag
<html>
<head><title>Hello JS</title>
</head>
</body>
` <h1>I am heading</h1>
<p>I am Paraghraph</p>
<script type="text/javascript">
document.write("Hello DevOpSchool");
</script>
</body>
</html>
External
Inside head tag
<html>
<head><title>Hello JS</title>
<script src="name.js" type="text/javascript">
</script>
</head>
</body>
` <h1>I am heading</h1>
<p>I am Paraghraph</p>
</body>
</html>
*Save with .js extension
Ex:- name.js
*Now link this file to HTML
Inside Body tag
<html>
<head><title>Hello JS</title>
</head>
</body>
` <h1>I am heading</h1>
<p>I am Paraghraph</p>
<script src="name.js" type="text/javascript">
</script>
</body>
</html>
*Save with .js extension
Ex:- name.js
*Now link this file to HTML
- Sonarqube: java.lang.IllegalStateException: Error status returned by url 401 - September 9, 2024
- SonarQube Error: Error status returned by url [https://api.sonarcloud.io - September 5, 2024
- AWS SES Errors and Solution - September 2, 2024