JavaScript
General
Introduction
JavaScript
is a programming language commonly used in web development. It was
originally developed by Netscape as a means to add dynamic and interactive
elements to websites.
JavaScript
is a client-side scripting language, which means the source code is
processed by the client's web browser rather than on the web
server. This means JavaScript functions can run after a webpage
has loaded without communicating with the server. For example, a JavaScript
function may check a web form before it is submitted to make sure all the
required fields have been filled out. The JavaScript code can produce
an error message before any information is actually transmitted to the server.
JavaScript
Versions
There
have been several formal versions of JavaScript.
- 1.0 Netscape 2
- 1.1 Netscape 3 and Explorer 3
- 1.2 Early Version 4 browsers
- 1.3 Early Version 4 browsers and Version 5 browsers
- 1.4 Netscape Servers
- 1.5 Current version
Security
- JavaScript cannot read files from or write them to the file system on the computer.
- JavaScript cannot execute any other programs
- JavaScript cannot establish any connection to whatever computer, except to download a new HTML page or to send mail. This, too, would create unacceptable hazards
Sample
Code
Basic
JavaScript function that adds two numbers
<script>
function
addNumbers(x,y)
{
return x+y;
}
var
ans = addNumbers(5,6);
console.log(ans);
</script>
Comments
Post a Comment