Javascript Ppt

Preview:

Citation preview

AgendaAgenda

Basic JavaScript Syntax Basic JavaScript Syntax &&

It’s Usage It’s Usage

In the HTML pageIn the HTML page

A String in JavaScript is a sequence of characters.

Strings are instances of the String class:

You can access individual characters within a string using the charAt() method.

You cannot use quotes of the same type inside the quotes unless they are escaped.

JavaScript provides a Boolean data type with true and false literals.

The typeof operator returns the string "boolean" for these primitives.

An Array is a native JavaScript type specifically designed to store data values indexed by integer keys.

Arrays, unlike the basic Object type, are prototyped with methods and properties to aid the programmer in routine tasks (e.g., join, slice, and push).

Advanced JavaScript Syntax Advanced JavaScript Syntax &&

It’s Usage It’s Usage

We Can Do Inheritance in JavaScript Screen below show same thing

Now we will make another class which will inherit from Parenizor, which is same except that its toString method will produce “-0-” if the value is zero or empty.

To Handle Exception in JavaScript we have to use try..catch..finally Block, that we usually used in Java

How To Use JavaScript Inside How To Use JavaScript Inside IDEIDE

To create a new JavaScript file, use the new file wizard and select MyEclipse > Web > JavaScript file as shown below.

Play with HTML using JavaScriptPlay with HTML using JavaScript

Problem : Create a table having one row only. When you Click on AddRow Button it will Add new row to that table?

Solution :

Play with JavaScript & CookiesPlay with JavaScript & Cookies

How To Debug JavaScript CodeHow To Debug JavaScript Code

To get to the debugger just press SHIFT+F12.

You can also use context menu or keyboard shortcut (F9) to set breakpoints on the script statement at the cursor location in source viewer.

For Step Into : You can either use toolbar button or keyboard shortcut F11 .

For Step Over: You can either use toolbar button or keyboard shortcut F8.

For Step Out : You can either use toolbar button or keyboard shortcut SHIFT+F11.

Thank YouThank You

Recommended