Презентация Using objects in JavaScript. Accessing DOM in JavaScript онлайн
На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Using objects in JavaScript. Accessing DOM in JavaScript абсолютно бесплатно. Урок-презентация на эту тему содержит всего 53 слайда. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » Using objects in JavaScript. Accessing DOM in JavaScript
Оцените!
Оцените презентацию от 1 до 5 баллов!
- Тип файла:ppt / pptx (powerpoint)
- Всего слайдов:53 слайда
- Для класса:1,2,3,4,5,6,7,8,9,10,11
- Размер файла:2.22 MB
- Просмотров:72
- Скачиваний:0
- Автор:неизвестен
Слайды и текст к этой презентации:
№7 слайд
![Loops keywords break and](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img6.jpg)
Содержание слайда: Loops: keywords break and continue
There are two keywords for loops control :
break – aborts loop and moves control to next statement after the loop;
continue – aborts current iteration and immediately starts next iteration.
Try not to use this keywords. A good loop have one entering point, one condition and one exit.
№9 слайд
![Collections Collection is a](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img8.jpg)
Содержание слайда: Collections
Collection is a set of variables grouped under common name.
Usually elements of collections are grouped according to some logical or physical characteristic.
Collections help to avoids situations when we have to declare multiple variables with similar names::
var a1, a2, a3, a4…
There are two types of collections that are typical for JS: arrays and dictionaries (hash tables).
№10 слайд
![Array processing Usage of](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img9.jpg)
Содержание слайда: Array: processing
Usage of arrays:
var array = [] // declaration of empty array
var array = [5, 8, 16] // declaration of predefined array
array[0] = 4; // writing value with index 0
tmp = array[2]; // reading value by index (in tmp - 16)
array.length // getting length of array
№11 слайд
![Array features Arrays in](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img10.jpg)
Содержание слайда: Array: features
Arrays in JavaScript differ from arrays in classical languages.
Arrays in JS are instances of Object.
So Array in JS can be easily resized, can contain data of different types and have string as an index.
Length of array is contained in length property, its value is equal to index of last element increased by one.
№16 слайд
![Array vs Dictionary Use Array](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img15.jpg)
Содержание слайда: Array vs Dictionary
Use Array for collections with digital indexes.
Use Hash if you want use string keys.
Don't look for property length in Hash.
Don't look for forEach and other Array methods in Hash.
Always explicitly declare Array otherwise you get a Hash.
Don't use for with hash, use for-in instead.
At finally : use collection – be cool :)
№21 слайд
![Constructors Sometimes we](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img20.jpg)
Содержание слайда: Constructors
Sometimes we need to create more than one single object. It is not a good idea to use the literal way for this. It will be better create a scenario for objects reproducing.
Constructor is a function that implements this scenario in JavaScript.
Constructor consists of declaration attributes and methods that should be added into each new object with presented structure.
№25 слайд
![Event handling But JavaScript](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img24.jpg)
Содержание слайда: Event handling
But JavaScript doesn't observe events by default. You should specify to your code what events are interesting for it.
There are 3 basic ways to subscribe to an event:
- inline in HTML
- using of onevent attribute
using special methods
First and second ways are deprecated for present days. Let's take a look at event handling in more details.
№40 слайд
![Context It works because we](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img39.jpg)
Содержание слайда: Context
It works because we use the next form of access to attribute name: this.name.
this contains inside a reference to object on whose behalf was called method run.
Such a reference is called a context.
The context determined automatically after the method calling and can't be changed by code.
№43 слайд
![Basic info Free space in](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img42.jpg)
Содержание слайда: Basic info
Free space in browser sandbox is allocated for each variable in JavaScript.
Sandbox is a special part of memory that will be managed by browser: JavaScript takes simplified and secure access to "memory“, browser translates JS commands and does all low-level work.
As a result memory, PC and user data has protection from downloaded JavaScript malware.
№44 слайд
![Scope The scope is a special](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img43.jpg)
Содержание слайда: Scope
The scope is a special JavaScript object which was created by browser in the sandbox and used for storing variables.
Each function in JavaScript has its own personal scope. Scope is formed when a function is called and destroyed after the function finishes.
This behavior helps to manage local variables mechanism.
Object window is a top-level scope for all default and global variables.
№46 слайд
![Value-types and](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img45.jpg)
Содержание слайда: Value-types and Reference-types
Unfortunately some objects are too large for scope. For example string or function. There is simple division into value-types and reference-types for this reason.
Value-types are stored in scope completely and for reference-types only reference to their location is put in scope. They themselves are located in place called "memory heap".
String and all Objects are reference-types. Other data types are stored in scope.
№47 слайд
![Memory cleaning The basic](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img46.jpg)
Содержание слайда: Memory cleaning
The basic idea of memory cleaning: when function is finished, scope should be destroyed and as a result all local variables should be destroyed.
This will work for value-types.
As for reference-types: deleting the scope destroys only reference. The object in heap itself will be destroyed only when it becomes unreachable.
№48 слайд
![Unreachable links An object](/documents_6/1b7a21d452f6bffcafb8787805acd1c5/img47.jpg)
Содержание слайда: Unreachable links
An object is considered unreachable if it is not referenced from the client area of code.
Garbage collector is responsible for the cleanup of unreachable objects.
It's a special utility that will launch automatically if there isn’t enough space in the sandbox.
If an object has at least one reference it is still reachable and will survive after memory cleaning.
Скачать все slide презентации Using objects in JavaScript. Accessing DOM in JavaScript одним архивом:
Похожие презентации
-
Module 7: Accessing DOM with JavaScript
-
DOM Document Object Model - объектная модель документа
-
Using jquery. Creating animations, working with graphics, and accessing data
-
JavaScript. Занятие 18
-
JavaScript. Плюсы и минусы
-
Обработка событий в JavaScript. Лекция 9
-
Язык программирования JavaScript
-
DOM-манипуляции
-
JavaScript. Функции
-
Языки программирования. Модуль random. Генерация случайных чисел