JavaScript PowerPoint Presentation, PPT - DocSlides

Download ellena-manuel | 2017-05-09 | General Shadi. . Banitaan. 1. Outline. Introduction. JavaScript Functions. Using Objects in . JavaScript. Built-in Objects. User-Defined Objects. Examples. Events. 2. Java . vs. JavaScript. 3. JavaScript. Java. ID: 546556

PowerPoint JavaScript PowerPoint Presentation, PPT - DocSlides Slideshow

Slide1JavaScriptShadi Banitaan1.Slide2OutlineIntroductionJavaScript FunctionsUsing Objects in JavaScriptBuilt-in ObjectsUser-Defined Objects

  • Views 163
Download this presentation

JavaScript PowerPoint Presentation, PPT - DocSlides

Click below link (As may be) to download this presentation.

Download Note - The PPT/PDF document "JavaScript PowerPoint Presentation, PPT ..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentations text content in JavaScript PowerPoint Presentation, PPT - DocSlides

  • JavaScript
  • Shadi Banitaan
  • 1
  • Outline
  • IntroductionJavaScript FunctionsUsing Objects in JavaScriptBuilt-in ObjectsUser-Defined ObjectsExamplesEvents
  • 2
  • Java vs JavaScript
  • 3
  • JavaScript
  • Java
  • Interpreted (not compiled) by client.
  • Compiled on server before execution on client.
  • Object-based. Code uses built-in, extensible objects, but no classes
  • Object-oriented. Applets consist of object
  • classes
  • Code integrated with, and embedded in, HTML.
  • Applets distinct from HTML (accessed from HTML pages).
  • Variable data types not declared (loose typing).
  • Variable data types must be declared (strong typing).
  • Web Scripting Languages
  • Fewer features Can be client side or Server sideServer sideInvoked from browserRun on the serverClient side - JavaScriptInvoked and Run on the browser
  • 4
  • Adding Integers
  • 5
  • Adding Integers
  • 6
  • JavaScript: Functions
  • A function is a block of organized reusable code (a set of statements) for performing a single or related action.Begins with keyword “function” and the function name and “( … )”Inside the parenthesesWe can pass parameters to the functionE.g. function myfunction(arg1, arg2) {…}Built-in and user-defined functions
  • 7
  • Built-In Functions
  • Functions provided by the language and you cannot change them to suit your needs.Some of the built-in functions in JavaScript are shown here:isFinite: Determines if a number is finiteisNaN: Determines whether a value is “Not a Number”
  • 8
  • User-Defined Functions
  • 9
  • 0
  • JavaScript: Objects
  • You can instantiate an object by using the constructor functionJavaScript is said to be an Object-based programming languageWhat is property?A variable belongs to the object.What is method?It is a function belongs to the object
  • 10
  • 1
  • JavaScript: Objects
  • Built-in Objects: Math, Array, and String. E.g.) Math.random()User-Defined Objects:The Class: JavaScript uses functions as classes. E.g.) function Person() { }The Object (Class Instance)var person1 = new Person();var person2 = new Person();The Property (object attribute): Properties are variables contained in the class
  • 11
  • 2
  • Math Object
  • 12
  • 3
  • Math Object
  • 13
  • 4
  • String Object
  • 14
  • 5
  • String Object
  • 15
  • 6
  • Date Object
  • 16
  • 7
  • Date Object
  • 17
  • 8
  • Date Object
  • 18
  • 9
  • document Object
  • Each HTML document loaded into a browser window becomes a Document object.Provided by the browser and allows JavaScript code to manipulate the current document in the browser
  • 19
  • 0
  • document Object
  • 20
  • 1
  • document Object
  • 21
  • 2
  • Extracting document information
  • 22
  • 3
  • Extracting document information
  • 23
  • 4
  • Boolean Object
  • The Boolean object is used to convert a non-Boolean value to a Boolean value (true or false).
  • 24
  • 5
  • Number
  • Object
  • The Number object is an object wrapper for primitive numeric values.
  • 25
  • 6
  • JavaScript: user-defined objects
  • Fields Can Be Added On-the-FlyAdding a new property (field) is a simple matter of assigning a value to oneIf the field doesn’t already exist when you try to assign to it, JavaScript will create it automatically.For instance:var test = new Object();test.field1 = "Value 1"; // Create field1 propertytest.field2 = 7; // Create field2 property
  • 26
  • 7
  • Literal Notation
  • We can create objects using a shorthand “literal” notation of the form { field1:val1, field2:val2, ... , fieldN:valN }For example, the following gives equivalent values to object1 and object2var object1 = new Object();object1.x = 3;object1.y = 4;object1.z = 5;object2 = { x:3, y:4, z:5 };
  • 27
  • 8
  • Objects: Iterates Over Properties
  • JavaScript, unlike Java or C++, has a construct that lets you easily retrieve all of the fields of an objectThe basic format is as follows:For (fieldName in object) { doSomethingWith(fieldName);}Also, given a field name, you can access the field via object["field"] as well as via object.field
  • 28
  • 9
  • Objects: Iterates Over Properties
  • 29
  • 0
  • Objects: Iterates Over Properties
  • 30
  • 1
  • Objects: Constructor
  • A “Constructor” is Just a Function that Assigns to “this”JavaScript does not have an exact equivalent to Java’s class definitionThe closest you get is when you define a function that assigns values to properties in the this reference function Ship(x, y, speed, direction) {this.x = x;this.y = y;this.speed = speed;this.direction = direction;}
  • 31
  • 2
  • Example (Constructor)
  • 32
  • 3
  • Example (Prototype)
  • 33
  • 4
  • Example (User-defined Object)
  • 34
  • 5
  • Example (User-defined Object)
  • 35
  • 6
  • Example (Instance)
  • 36
  • 7
  • Nested Object
  • 37
  • 8
  • Events
  • JavaScript events
  • allow scripts to respond to user interactions and modify the page accordingly
  • Events and event handling
  • help make web applications more dynamic and interactive
  • 9
  • Simple button
  • 39
  • 0
  • Mouse Events
  • 40
Recommended
Supply Chain Planning
  • 107

Supply Chain Planning

Practical guide: Medical Imaging Concepts
  • 62

Practical guide: Medical Imaging Concepts

Where do diamonds come from?
  • 90

Where do diamonds come from?

A PRACTICAL WAY TO INTRODUCE A WORLDWIDE JEWELLERY ETHICAL
  • 55

A PRACTICAL WAY TO INTRODUCE A WORLDWIDE JEWELLERY ETHICAL

Welcome to Snap! Below the Line Decal
  • 58

Welcome to Snap! Below the Line Decal

Macroprudential Surveillance
  • 47

Macroprudential Surveillance

HD Series
  • 32

HD Series

w ebinar 6
  • 47

w ebinar 6

Wings of Fire
  • 65

Wings of Fire

Report this Document.