introduction to javascript - springpeople

11
© SpringPeople Software Private Limited, All Rights Reserved. © SpringPeople Software Private Limited, All Rights Reserved. Introduction to

Upload: springpeople

Post on 03-Aug-2015

914 views

Category:

Education


3 download

TRANSCRIPT

Page 1: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved. © SpringPeople Software Private Limited, All Rights Reserved.

Introduction to

Page 2: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

What is Javascript?

• JavaScript adds interactivity to HTML pages.

•JavaScript is a lightweight scripting programming language.

•A JavaScript is usually embedded directly into HTML pages.

•JavaScript is an interpreted language. The scripts execute without preliminary compilation.

•No License is required to use Javascript

Page 3: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

JavaScript Functions

• A JavaScript function is a block of code designed to perform a particular task.

• A JavaScript function is executed when "something" invokes it (calls it).

• A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses ().

• Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).

• The parentheses may include parameter names separated by commas: (parameter1, parameter2, ...)

• The code to be executed, by the function, is placed inside curly brackets: {}

Page 4: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

Closures In Javascript

• A closure is an inner function that has access to the outer (enclosing) function’s variables—scope chain. The closure has three scope chains: it has access to its own scope (variables defined between its curly brackets), it has access to the outer function’s variables, and it has access to the global variables.

• The inner function has access not only to the outer function’s variables, but also to the outer function’s parameters. Note that the inner function cannot call the outer function’s argumentsobject, however, even though it can call the outer function’s parameters directly.

Page 5: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

Object-Oriented JavaScript

• Object Oriented Programming (OOP) refers to using self-contained pieces of code to develop applications. We call these self-contained pieces of code objects, better known as Classes in most OOP programming languages and Functions in JavaScript. We use objects as building blocks for our applications. Building applications with objects allows us to adopt some valuable techniques, namely, Inheritance (objects can inherit features from other objects), Polymorphism (objects can share the same interface—how they are accessed and used—while their underlying implementation of the interface may differ), and Encapsulation (each object is responsible for specific tasks).

Page 6: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

• One of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language.

• JavaScript allows you to work with three primitive data types:

• Numbers eg. 123, 120.50 etc.

• Strings of text e.g. "This text string" etc.

• Boolean e.g. true or false.

• JavaScript also defines two trivial data types, null and undefined, each of which defines only a single value.

• In addition to these primitive data types, JavaScript supports a composite data type known as object.

JavaScript Data Types

Page 7: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

JavaScript Variables

• Like many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container.

• The scope of a variable is the region of your program in which it is defined. JavaScript variable will have only two scopes.

• Global Variables: A global variable has global scope which means it is defined everywhere in your JavaScript code.

• Local Variables: A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.

Page 8: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

JavaScript templates

• Javascript templates are rendered and cached client-side without sending an HTTP request to the server — in other words, they’re lightning fast.

• An alternative approach to XUL's own templating system is to use JavaScript templates.

• This approach also provides a separation of formatting and structure from content, but relies on a JavaScript templating engine to have JavaScript-side business logic inject content into a template. And this does not require any use of RDF/XML, etc.

Page 9: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

How you can master Javascript?

Become an expert in 2 days.

World class Javascript training by the industry experts.

More Details

Page 10: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

Suggested Audience & Other Details

• Suggested Audience - Web developer who wants to build best-of-breed web UIs with the simplicity and elegance of JavaScript.

• Duration – 2 Days

• Prerequisites – Web development experience with HTML, CSS, JavaScript and jQuery

– Exposure to any server technology (J2EE, .NET, Ruby etc)

Syllabus

Page 11: Introduction To Javascript - SpringPeople

© SpringPeople Software Private Limited, All Rights Reserved.

For further info/assistance contact

[email protected]

+91 80 656 79700

www.springpeople.com

Our Partners