HTML is a great language, but it is limited in what it allows a web designer to offer. If a designer wants to add interesting functionality and dynamic content, like games, animation, and interactive elements, he or she must use a language like JavaScript. One downside to the language being client-side is that malicious code (a.k.a. malware) can make its way onto client machines without the owner's consent. Once running on the client, these malicious programs can damage the computer system or can provide access to those wanting to use the machine for a variety of illegal activities.
JavaScript was originally developed by Brendan Eich of Netscape (see photo above). He called it Mocha, and the language was meant to resemble another language called Java. JavaScript began its life being used within the Netscape web browser, which evolved into the Mozilla Firefox browser. Ajax (an acronym for Asynchronous JavaScript and XML) has become a popular technique used in web development. Ajax uses a variety of languages and client-side technologies, one of which is JavaScript.
JavaScript and Java are not very similar. JavaScript is one of the easiest languages for non-programmers to understand and create. JavaScript code does not usually run independently as another file of code; it is embedded within the HTML code. JavaScript code is usually placed in both the head and body areas of a web document.
Here is a summary of the characteristics of JavaScript (courtesy of w3schools.com):
- JavaScript was designed to add interactivity to HTML pages
- JavaScript is a scripting language
- A scripting language is a lightweight programming language
- JavaScript is usually embedded directly into HTML pages
- JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
- Everyone can use JavaScript without purchasing a license
A few sites where you can see and even borrow JavaScript code for your own web pages:
JavaScript Kit
JavaScript Source
Dynamic Drive
No comments:
Post a Comment