50

Javascript Ppt

Embed Size (px)

Citation preview

Page 1: Javascript Ppt
Page 2: Javascript Ppt

AgendaAgenda

Page 3: Javascript Ppt
Page 4: Javascript Ppt
Page 5: Javascript Ppt
Page 6: Javascript Ppt
Page 7: Javascript Ppt

Basic JavaScript Syntax Basic JavaScript Syntax &&

It’s Usage It’s Usage

Page 8: Javascript Ppt

In the HTML pageIn the HTML page

Page 9: Javascript Ppt
Page 10: Javascript Ppt
Page 11: Javascript Ppt
Page 12: Javascript Ppt

A String in JavaScript is a sequence of characters.

Strings are instances of the String class:

Page 13: Javascript Ppt

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.

Page 14: Javascript Ppt

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

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

Page 15: Javascript Ppt

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).

Page 16: Javascript Ppt
Page 17: Javascript Ppt
Page 18: Javascript Ppt
Page 19: Javascript Ppt
Page 20: Javascript Ppt
Page 21: Javascript Ppt
Page 22: Javascript Ppt
Page 23: Javascript Ppt
Page 24: Javascript Ppt
Page 25: Javascript Ppt

Advanced JavaScript Syntax Advanced JavaScript Syntax &&

It’s Usage It’s Usage

Page 26: Javascript Ppt
Page 27: Javascript Ppt
Page 28: Javascript Ppt

We Can Do Inheritance in JavaScript Screen below show same thing

Page 29: Javascript Ppt

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.

Page 30: Javascript Ppt

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

Page 31: Javascript Ppt

How To Use JavaScript Inside How To Use JavaScript Inside IDEIDE

Page 32: Javascript Ppt

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

Page 33: Javascript Ppt
Page 34: Javascript Ppt

Play with HTML using JavaScriptPlay with HTML using JavaScript

Page 35: Javascript Ppt

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

Page 36: Javascript Ppt

Solution :

Page 37: Javascript Ppt
Page 38: Javascript Ppt
Page 39: Javascript Ppt

Play with JavaScript & CookiesPlay with JavaScript & Cookies

Page 40: Javascript Ppt
Page 41: Javascript Ppt
Page 42: Javascript Ppt
Page 43: Javascript Ppt
Page 44: Javascript Ppt
Page 45: Javascript Ppt
Page 46: Javascript Ppt

How To Debug JavaScript CodeHow To Debug JavaScript Code

Page 47: Javascript Ppt

To get to the debugger just press SHIFT+F12.

Page 48: Javascript Ppt

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.

Page 49: Javascript Ppt

Thank YouThank You

Page 50: Javascript Ppt