Screen output and keyboard input
MODULE IV
• Introduction to JavaScript and jQuery - The Basics of JavaScript: Overview of JavaScript, Object Orientation and
General | Syntactic | Characteristics- |
---|
• Originally developed by Netscape
• JavaScript was invented by Brendan Eich in 1995
• Joint Development with Sun Microsystems in 1995
• can be run on any operating systems and almost all web browsers.• ECMA-262 edition 3 is the current standard
– Edition 4 is under development
• Supported by Netscape, Mozilla, Internet Explorer
• Used to create cookies.
JavaScript Components
|
JavaScript | |
---|---|---|
|
|
|
---|---|
|
||||
|
---|
Similarity between java & JavaScript• Syntax of their expressions , assignment statements & control statements
• The main task of most JavaScript programs is to respond to events
• For example, a JavaScript program could validate data in a form before it is submitted to a server
– JavaScript in the body element will be executed once as the page is loaded
Object Orientation and JavaScript
• Root object in JavaScript is Object
• The Object object is the ancestor of all
objects in a JavaScript program
– Object has no data properties, but several method properties
JavaScript in XHTML
• Must begin with a letter, an underscore or a dollar sign
• No length limitations for identifiers
1. |
|
---|
,the rest of the line is considered as comment 2. /*…………………*/ (single & multiple line
comments)
• |
---|
– Simply ignore the contents of the script element & cause no problems.
• Old browsers does not recognize the script tag, simply read as text
• This, however does not work, at least in Firefox:
<script type=“text/javascript”>
• The problem seems to be that the CDATA tag causes an internal JavaScript error
JavaScript in XHTML: CDATA (2)