JavaScript is a programming language used primarily by Web browsers to create a dynamic and interactive experience for the user. The earliest incarnations of JavaScript were developed in the late 1990s by Brendan Eich for the Netscape Navigator Web browser. For the first time, JavaScript enabled animation, adaptive content and form validation on the page.
JavaScript did not become standardized and widely adopted until 1999. Even after standardization, browser compatibility remained an issue for over a decade and for many years; JavaScript only functioned on a limited number of browsers. Microsoft's Internet Explorer, the largest browser base, did not support JavaScript until much later. As I know JavaScript and Java are very much unrelated. Java is a very complex programming language whereas JavaScript is only a scripting language. The syntax of JavaScript is mostly influenced by the programming language C.
If we discuss about important of JavaScript:
The language JavaScript as a web technology can be determined from the
fact that it is currently used by 94.5% of all websites. As a client-side
programming language, JavaScript helps web developers to make web pages dynamic
and interactive by implementing custom client-side scripts.
At the same time, we (developers) can also use cross-platform runtime
engines like Node.js to write server-side code in JavaScript. They can even combine
JavaScript, HTML5 etc to create web pages because they look good across
browsers and devices.
How to Run JavaScript?
As above mentioned,
being
a scripting language, JavaScript cannot run on its own. In fact, the browser is
responsible for running JavaScript code. When a user requests an HTML page with
JavaScript in it, the script is sent to the browser and it is up to the browser
to execute it. The main advantage of JavaScript is that all modern web browsers
support JavaScript. So, we do not have to worry about whether we site visitor
uses Internet Explorer, Google Chrome, Firefox or any other browser. Also,
JavaScript runs on any operating system including Windows, Linux or Mac.
To start with, we need
a text editor to write our code and a browser to display the web pages we
develop. We can use a text editor of our choice including Notepad++, Visual
Studio Code, Sublime Text, Atom or any other text editor we are comfortable
with. We can use any web browser including Google Chrome, Firefox, Microsoft
Edge, Internet Explorer etc.
How Can we write Simple JavaScript Program?
We should place all our JavaScript code within <script> tags (<script> and </script>) if we are keeping our JavaScript code within the HTML document itself. This helps our browser distinguish our JavaScript code from the rest of the code. We have to use the type attribute within the <script> tag and set its value to text/javascript like this:
<script type="text/javascript">
Here is the Simple Program to
print Mahesh Prashad Joshi :
<html>
<head>
<title>This
is the first code</title>
<script
type="text/javascript">
alert("Mahesh
Prashad Joshi");
</script>
</head>
<body>
</body>
</html>
As the end we
can concluded that JavaScript is a client-side scripting language developed by
Brendan Eich. JavaScript can be run on any operating systems and almost all web
browsers. We need a text editor to write JavaScript code and a browser to
display our web page.
0 comments:
Post a Comment