Introducing JavaScript.
By: aathishankaran in Javascript Tutorials on 2007-03-21
Netscape initially developed JavaScript under the name of LiveScript. This scripting language was intended to extend the capabilities of basic HTML and provide an alternative to using CGI scripts. After Java's popularity, Netscape followed the notation of Java - hence, the name change to JavaScript.
Features of JavaScript
- JavaScript Is Embedded into HTML.
- If you deal with JavaScript, there is hardly any separation of the two. JavaScript code is usually housed within HTML documents and executed within them.
- JavaScript has no user interface; it relies on HTML to provide its means of interaction with the user.
- JavaScript uses HTML as a means of jumping into the Web application framework.
- It also extends the normal capabilities of HTML by providing events to HTML tags and allowing event-driven code to execute within it.
EXAMPLE for JavaScript embedded in an HTML file.
<html> <head> <title>Status Bar</title> <script> window.defaultStatus = "Welcome to the large URL page."; function changeStatus() { window.status = "Click me to go to the home page."; } function changeDefaultStatus() { window.defaultStatus = document.statusForm.messageList.options[document.statusForm.messageList.selectedIndex].text; } </script> </head> <body> <p align="center"> <font color="#008040"> <font size="7"><strong>https://www.java-samples.com</strong></font> </font> </p> <p align="center"> <a href="https://www.java-samples.com" onMouseOver="changeStatus();return true;">Go...</a> </p> <form name="statusForm" method="POST"> <p> <br> <br> <br> <br> </p> <p align="center"> <font size="1"> To change the default status bar message, select a message from the list below and click the Change button. </font> </p> <p align="center"> <select name="messageList" size="1"> <option selected>Welcome to the large URL page.</option> <option>On route to Java Samples</option> <option>This page intentionally left (nearly) blank.</option> <option>An exciting example of changing status bar text.</option> </select> <input type="button" onClick="changeDefaultStatus();" value="Change"> </p> </form> </body> </html>
Add Comment
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
- Your name, rating, website address, town, country, state and comment will be publicly displayed if entered.
- Aside from the data entered into these form fields, other stored data about your comment will include:
- Your IP address (not displayed)
- The time/date of your submission (displayed)
- Your email address will not be shared. It is collected for only two reasons:
- Administrative purposes, should a need to contact you arise.
- To inform you of new comments, should you subscribe to receive notifications.
- A cookie may be set on your computer. This is used to remember your inputs. It will expire by itself.
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
- Although the administrator will attempt to moderate comments, it is impossible for every comment to have been moderated at any given time.
- You acknowledge that all comments express the views and opinions of the original author and not those of the administrator.
- You agree not to post any material which is knowingly false, obscene, hateful, threatening, harassing or invasive of a person's privacy.
- The administrator has the right to edit, move or remove any comment for any reason and without notice.
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Comments