JavaScript Tutorial and Guide

July 31, 2008

Basic JavaScript Programming Interview Questions and Answers.

Filed under: Uncategorized — onlinewebtutorials @ 7:10 am
Tags: ,

What is JavaScript?

JavaScript is a general-purpose programming language designed to let programmers of all skill levels control the behavior of software objects. The language is used most widely today in Web browsers whose software objects tend to represent a variety of HTML elements in a document and the document itself. But the language can be–and is–used with other kinds of objects in other environments. For example, Adobe Acrobat Forms uses JavaScript as its underlying scripting language to glue together objects that are unique to the forms generated by Adobe Acrobat. Therefore, it is important to distinguish JavaScript, the language, from the objects it can communicate with in any particular environment. When used for Web documents, the scripts go directly inside the HTML documents and are downloaded to the browser with the rest of the HTML tags and content.

JavaScript is a platform-independent, event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems.

What’s relationship between JavaScript and ECMAScript?

ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3.

How do you submit a form using JavaScript?

Use document.forms[0].submit()

(0 refers to the index of the form – if we have more than one form in a page, then the first one has the index 0, second has index 1 and so on).

How to read and write a file using JavaScript?

I/O operations like reading or writing a file is not possible with client-side JavaScript. However , this can be done by coding a Java applet that reads files for the script

How to detect the operating system on the client machine?

In order to detect the operating system on the client machine, the navigator.appVersion string (property) should be used.

June 19, 2008

JavaScript examples At Global Guide Line!

Filed under: About Myself,Uncategorized — onlinewebtutorials @ 6:05 am

Welcome to Global Guide Line Technologies, the web designer’s resource for everything. We invite you to begin the tutorials right away, like HTML Tutorial, XML Tutorial, XSLT Tutorial, CSS Tutorial, SEO Tutorial, JavaScript Tutorial, SQL Tutorial, Database Articles, Web Hosting Guide and much more. The most common technologies used in making web pages, database interaction etc. We will help you to explore the resources of the World Wide Web and develop your skill from the basics to advance.

GlobalGuideLine.com web blog. This is an open web log to contribute you codding skills and share you knowledge with GlobalGuideLine.com

Fundamentals of JavaScript Examples

JavaScript Writing Text Example

Print Hello Word in JavaScript

Using HTML tags in JavaScript

Using JavaScript in HTML HEAD Section

Using JavaScript in HTML BODY Area

Using External JavaScript .js file

document.open document.write and document.close

JavaScript Statement, JavaScript Block and JavaScript Comments Examples

Example of JavaScript Simple Statement

Example of JavaScript Simple Block

Example of JavaScript Comments

Example of JavaScript Multiple Lines Comment

JavaScript Single Line Comment to stop execution

JavaScript Multiple Lines Comments to stop execution

JavaScript If Else and Switch Statements Examples

Example of JavaScript IF Statement

Example of JavaScript IF Else Statement

Dynamic HTML Heading displaying with If Else Statement

JavaScript Switch Statement

Breaking JavaScript Switch Statement

Example of conditional redirects with JavaScript.

JavaScript For, For In, Do, and Do While Loops Examples

Example of JavaScript For Loop

Example of JavaScript For In Loop

Example of JavaScript While Loop

Example of JavaScript Do While Loop

Displaying HTML Headings with For Loop using JavaScript

Breaking any JavaScript Loop

Example of Continue JavaScript Loop

Multiplication Table Using Nested Loops

Example of pausing For, For In, Do and Do While Loops in JavaScript

JavaScript Variables Examples

Declaring Initializing and using JavaScript Variable

Using JavaScript Variables to store Date Object values

JavaScript Alert, Confirmation and Prompt Boxes Examples

Example of JavaScript Alert Box

Example of JavaScript Confirmation Box

Example of JavaScript Prompt Box

Example of JavaScript Alert in Multiple Lines

Gues Game using Prompt and Alert Box

Examples of JavaScript Functions

Example of Simple JavaScript Function

Example of JavaScript Function With Arguments

Example of JavaScript Function with Return Value

Example of JavaScript Function With Return Type and Arguments

Date or Time Test Function

Example of Complete String Functions and Properties in JavaScript

JavaScript Error Handling Examples

Example of Simple JavaScript Exception Handling

Example of JavaScript Try Catch with redirection

Example of JavaScript onerror Event for Handling Error

Error Handling with Prime Test Function

JavaScript String Object Functions and Properties Examples

Example of string.charAt(int) Function using String Object

Example of JavaScript string.indexOf(str) Function

Example of JavaScript string.lastIndexOf(str) Function

Example of JavaScript string.subString(start, end) Function

Example of JavaScript string.length Property

Example of Complete String Functions and Properties in JavaScript

JavaScript Array Object Examples

Example of JavaScript Array Object Syntax

Example of sorting, concat, join and reverse Functions of Array Object

Example of random generated idea using JavaScript Array Object

Example of Two-Dimensional Array Object

Example of getting day of week using Array

Example of digital clock using Array Object

Example of getting full Date using Array Object

JavaScript Date Object Functions and Properties Examples

Complete Example of Date and Time using JavaScript

Example of setDate using JavaScript

Using JavaScript Variables to store Date Object values

Date or Time Test Function

Example of getting day of week using Array

Example of digital clock using Array Object

Example of getting full Date using Array Object

Example of days left until Christmas using JavaScript

Example of Calendar using JavaScript

JavaScript Math Object Functions and Properties Examples

Example of Math.min(int,int) and Math.max(int,int) using Math Object

Example of Math.abs(int) using Math Object

Example of Math.ceil(int) using Math Object

Example of Math.floor(int) using Math Object

Example of Math.pow(int,int) using Math Object

Example of Math.random() using Math Object

Example of Math.round(int) using Math Object

Example of Math.sqrt(int) using Math Object

JavaScript Boolean Object Examples

How to check Boolean values in JavaScript?

JavaScript Document Object Examples

Writing with Document Object

Formating output of Document Object

document.title in Document Object

document.URL in Document Object

document.domain in Document Object

document.referrer in Document Object

document.getElementById in Document Object

document.getElementsByName in Document Object

document.open document.write and document.close

document.anchors.length Document Object

document.bgColor Document Object

innerHTML in anchors of Document Object

document.forms.length, number of forms in document

Accessing an item of a form using Document Object

document.images.length in Document Object

JavaScript Event Object Examples

onAbort Event Object Example

onBlur Event Object Example

onChange Event Object Example

onClick Event Object Example

onError Event Object Example

onFocus Event Object Example

onLoad Event Object Example

onMouseOut Event Object Example

onMouseOver Event Object Example

onReset Event Object Example

onSelect Event Object Example

onSubmit Event Object Example

onUnload Event Object Example

Opening a child window that controls parent window using onClick

Opening a child window that controls parent window using onMouseOver

Form Object and Form Elements Examples

Simple Calculator using Forms Example

Light On/Off Example using Radio Buttons

Radio Button Test Example

Select your favorite browser Example

Temperature Conversion Example

Getting Form ID of of The Dropdown List.

document.forms.length, Checking number of forms in document

Double or Square using Radio Example

document.getElementById in Document Object

Check Box Selection Test

Accessing an item of a form using Document Object

document.getElementsByName in Document Object

Checkbox Calculator Example

Check/UnCheck All Checkboxes Example

Manipulating the Value of a Text Field Example

Detecting Text Field Events Example

Change the background color with onFocus Example

Swap the values of text boxes Example

Less Clutter Example (Removing default text box value using onBlur and onFocus)

Detecting Textarea Events Example

Detecting Multiple Options Selected Example

Jump to the next Text Box when the current box’s maximum length has been reached.

JavaScript Anchor Object Examples

Get focus with focus() and lost focus with blur() using Anchor Object Example

Adding an access key with accessKey to an Anchor Object Example

document.anchors.length Document Object

innerHTML in anchors of Document Object

Changing the text href and target of an Anchor Object Example

JavaScript Image Object Examples

Changing banner image using Image Object Example

Changing source of an Image Object Example

Changing Height and Width of an Image Object Example

document.images.length in Document Object [how many images are in a webpage?]

I mage Mapping using JavaScript Example

JavaScript Screen Object Examples

Detecting Screen details using Screen Object Example

JavaScript Navigator Object Examples

Detecting Browser using Navigator Object Example

Details of Browser detection using Navigator Object

All Methods and Properties of Navigator Object

Check your Browser, updateable or not.

JavaScript Table Header, Row, Cell and Data Objects Examples

Changing the width of table border

Multiplication Table Using Nested Loops

Changing cellPadding and cellSpacing of Table

Changing colspan of Table Rows

Changing content of Table Cell

Changing the alignment of cells content in row

Changing the vertical alignment of cells content in row

Changing the alignment of single cell content

Aligning the single cell content vertically

Specifying frames of Table

Specifying rules for Table

Getting innerHTML of a Row in Table

Getting innerHTML of a Cell in Table

Getting and Setting Caption (Header) of Table

Adding Rows of a Table

Adding Cells of a Table

Deleting Rows of of a Table

Examples of JavaScript Frame, Frameset and iFrame Objects

Set Resizable or fixed Frames at run time.

Enable or Disable Frames scrollbar using Frame Object.

Changing source of Frame at run time.

Breaking Frames in parts.

Setting iFrame source at run time.

Examples of JavaScript Select and Option Objects

Enable or Disable Dropdown List Example.

Getting Form ID of of The Dropdown List.

Check how many number of items are in Dropdown List.

Changing the Dropdown list size at run time.

Enable multiple selection in dropdown at run time.

Show the all items in Dropdown List.

Check the index of selected Dropdown List item.

Editing an item of Dropdown List.

Delete an item from Dropdown List.

Examples of JavaScript Location Object

Complete example of history and location Objects

Open New Location Example.

document.title in Document Object

document.URL in Document Object

Opening new window setting its URL at run time.

document.domain in Document Object

document.referrer in Document Object

Refresh page after few seconds.

Examples of JavaScript Windows Object

Open new window using button.

Example of Reloading opened window.

Opening new window and controlling its appearance.

Opening more then one windows on single click.

Opening new window setting its URL at run time.

Setting the positioning of new opened Windows

Opening Pop Up centered Window

Shifting focus between multiple opened Windows

Passing information from child opened Pop Up Window to the parent opened Window

Passing information from parent opened Window to the child Pop Up opened Window

Opening and Closing new Pop Up windows

Opening a child window that controls parent window using onClick

Opening a child window that controls parent window using onMouseOver

Opening a child window that controls an other child window

Opening new window with Image.

Opening Welcome window using cookies

Open any window after customizing.

Writing text on status bar of new opened windows.

Example of opening print dialog (Print your webpage).

Resize your opened window.

Resize opened window at runtime arguments.

Example of window.scrollBy. [Scroll your webpage automatically]

Making a delay with window.setTimeout()

Example of stop watch using window.setTimeout()

JavaScript Operators Examples.

JavaScript Assignment Operators Example

JavaScript Comparison Operators Example

JavaScript Computational Operators Example

JavaScript Logical Operators Example

JavaScript setTimeout() Function Examples.

setTimeout() and clearTimeout() Example in JavaScript

Making a delay with window.setTimeout()

Pausing JavaScript For, Do and While Loops using setTimeout() Example

Example of stop watch using window.setTimeout()

JavaScript Redirect Examples.

JavaScript Location.href Method Example.

JavaScript Location.replace Method Example.

Example of conditional redirects with JavaScript.

View Complete JavaScript Tutorial at below our website.
http://globalguideline.com/JavaScript_Guide/Complete_JavaScript_Examples.php
http://www.globalguideline.com web blog.

Create a free website or blog at WordPress.com.