Вы находитесь на странице: 1из 4

JAVASCRIPT

Introduction

JavaScript is a very powerful client-side scripting language.


JavaScript is used mainly for enhancing the interaction of a user with
the webpage. In other words, you can make your webpage more lively
and interactive, with the help of JavaScript. JavaScript is also being
used widely in game development and Mobile application development.

Application of JavaScript

JavaScript is used to create interactive websites. It is mainly used for:

o Client-side validation,
o Dynamic drop-down menus,
o Displaying date and time,
o Displaying pop-up windows and dialog boxes (like an alert dialog
box, confirm dialog box and prompt dialog box),
o Displaying clocks etc

Use of java Script

Javascript is one of the most used languages in the market these


days. Below graph shows a graphical representation of a company for all
languages. JavaScript stands second in the lineup. It is mainly used in
building websites and web applications. The other application of
JavaScript is listed below.

 Web Development
 Web Applications
 Presentations
 Server Applications
 Web Servers
 Games
 Art
 Smartwatch Applications
 Mobile Applications
 Flying Robots

Advantages of JavaScript :

 Fast to the end user: Java scripting is written for client-side, it does
not need the web server's support for execution. It also has no need
to be compiled on the client side which gives it certain speed
advantages. As the script is executed on the user’s computer,
depending on task, the results are completed almost instantly. For
example, you can validate any user input before sending a request
to the server. This makes less load on the server.

 Simplicity: JavaScript is relatively simple to learn and implement.


It uses the DOM model that provides plenty of prewritten
functionality to the various objects on pages making it a breeze to
develop a script to solve a custom purpose.

 Versatility: JavaScript plays nicely with other languages and can


be used in a huge variety of applications. Nowadays, there are
many ways to use JavaScript through Node.js servers. If you were
to bootstrap node.js with Express, use a document database like
mongodb, and use JavaScript on the front-end for clients, it is
possible to develop an entire JavaScript app from front to back
using only JavaScript.

Disadvantages of JavaScript :

 Security : JavaScript is explicitly added to web pages and client


browsers, it can exploit user's system, so malicious code can be
executed on client machine.

 Browser Support: JavaScript is sometimes interpreted differently


by different browsers. Different layout engines may render
Javascript differently resulting in inconsistency in terms of
functionality and interface. Most of the JavaScript depends on the
manipulation of Browsers DOM elements. And, different browsers
given different type of access to objects, specifically Internet
Explorer.

 More and better Competitor : JavaScript is a very old scripting


language running on the machines and there are other technologies
which are doing the same thing in place of it (ex. JQuery ) in a
better and easy way.

 Disable JavaScript: If you are disable JavaScript in browser, the


entire JavaScript code is not run.

 File Download: JavaScript file is download on client machine so


anyone can read the code and reuse it.

<html>
<head>
<title>My First JavaScript code!!!</title>
<script type="text/javascript">
alert("Welcome to CSE Department");
</script>
</head>
<body>
</body>
</html>

<html>
<head>
<script type="text/javascript">
function msg(){
alert("Hello Student");
}
</script>
</head>
<body>
<p>Welcome to BKEC</p>
<form>
<input type="button" value="click" onclick="msg()"/>
</form>
</body>
</html>