Friday, November 16, 2007

Day 1

Online tutorial:

http://expertrating.com/courseware/JavaScriptCourse/JavaScript-Introduction-1.asp
HTML tags - Hypertext Markup Language tags are part of the language that powers web pages and delivers instruction to your web browser to display the page information in more than just plain text. example: Position Masters (<> < /b >turns text into bold).

Purpose:
Embedding JavaScript in an HTML program makes them interactive or dynamic.

Capabilities:
1. Get input from a user
2. Detect browser
3. Create cookies
4. Can create primitive games, create calculator, or show the current date and time

Two types
1. client side/ navigator
2. server side/ live script

JavaScript used mostly on client side web development.

Scripting Language: A high-level programming language that is interpreted by another program/application at runtime rather than compiled by the computer’s processor(like other programming languages as C and C++).

Scripting languages, which can be embedded within HTML, commonly are used to add functionality to a Web page, such as different menu styles or graphic displays or to serve dynamic advertisements. These types of languages are client-side scripting languages, affecting the data that the end user sees in a browser window.

Other scripting languages are server-side scripting languages that manipulate the data, usually in a database, on the server.

Scripting languages came about largely because of the development of the Internet as a communications tool. JavaScript, ASP(Active Server Pages), JSP(Java Server Pages), PHP(Hypertext Preprocessor:Server Side), Perl, Tcl and Python are examples of scripting languages.

JavaScript is architecture-neutral & is understood by any enabled browser. JavaScript is best supported for Netscape!

JavaScript is case sensitive.

Advantages of JavaScript
1. Interactivity to web pages
2. Validation of user input before submission to server
3. Event-driven programming with buttons etc.
4. GUI features as prompts, alerts etc.
5. Cookies to save and retrieve info on client computer
6. Navigator objects to get info about the client browser
7. Syntax for coding on web page
8. Java Script clock & functions for calculator etc..

Fill in the blanks:
1. JavaScript is an object-based scripting language.
2. JavaScript is created by Netscape.
3. Client-side JavaScript is called Navigator JavaScript.

True or False

1. JavaScript needs compiler. F
2. JavaScript is not an architecture neutral language. F
3. JavaScript is a case-sensitive language. T
4. The default scripting language of Netscape is VBScript. F


Script tag can be placed on the html head, body or in external(*.js)file.
Placing in head->reduces scope of error.
If the Language attribute is left undefined then the default scripting language of Netscape is JavaScript, whereas Internet Explorer has VB Script as its default scripting language.

document.write is a standard JavaScript command for writing output to a page. The language attribute indicates the scripting language used for writing the piece of scripting code.

Fill in the Blanks

1. JavaScript is embedded between SCRIPT tags of HTML.
2. The extension of external JavaScript file is .js.

True or False

1. tag should always be placed in the head section to reduce errors. F
2. External JavaScript file can contain HTML tags. F
3. It would be an error if you place tag at both head section as well as inside body section also. F