Javascript Object: creating objects and working

A web resource visit is a specific URI in the address bar of a browser. The visitor indicates the address of the page, and it is parsed by the browser into the elements of the DOM tree - Document Object Model. Any link on this page tells the browser to parse another page and build a different tree of objects.

javascript object




The browser allows the visitor to go back or go forward along the chain of pages that have already been viewed in the current session.

In fact, user actions are moving between systems of objects formed in the process of visiting pages. Each page is its own DOM tree and, in addition, JavaScript object's are syntax objects of the language itself and user descriptions.

DOM: Download, Update and Change

, -, DOM JavaScript, , , :

  • - ;
  • - ( Ctrl-F5);
  • , (AJAX, , , ...).

, . - «» , .





, . , .

object javascript




(, AJAX) - . , , , .

JavaScript

JavaScript . - . , .

object keys javascript




, "", "", true, false, null undefined, . , DOM JavaScript Object's. .









, Math. , - .

Author's example is not a picture




DOM . JavaScript object function's - .

,

JavaScript : "" = "" . object JavaScript - "" = "". "" , .

. , , ( . . ) .

javascript delete object




, , , . , - .

:

  • ;
  • .

JavaScript object - , - , , .

, .

Object.keys: JavaScript . , , .

Author's example is not a picture




. , . .

:

  • x1_Obj.NameLast;
  • x1_Obj['NameFirst'].

. "{}" "," ( ). , .

- , JavaScript delete object ( - ) .

javascript object properties




:

  • delete x1_Obj.NameLast;
  • delete x2_Obj['NameFirst'];

, - . false, .

JavaScript object properties functions () . , .

javascript object event




- - JavaScript.

Author's example is not a picture




x3_Obj, : item pos. hello() . , JavaScript object values , , (1) .

Hello() () (2) .

this

this .

Author's example is not a picture




. . :

  • var oCookie = new scCookies(cOwnerCode);
  • oCookie.Init();

cOwnerCode - . , oCookie . , , this :

  • this.GetCookie = function(cName) { ... };
  • this.SetCookie = function(cName, cValue) { ... }.

.

  • this.GetCookie('cOwner');
  • this.SetCookie('cOwner', cOwner);

, , .

, JavaScript Object's - , . , , . DOM , - JavaScript.

javascript object function




- . - . - . : = , - .

. ( ), .

, DOM JavaScript : () .

- , (). , .

.

DOM JavaScript: object event's - . .

javascript object values




JavaScript «» , , , .

Object event - , . , .

, - , - , AJAX .

, , , .

"" URI, -, , DOM - -. .

-, . , :

  • ;
  • / (AJAX);
  • ;
  • ( );
  • ;

, , . JavaScript, , .

javascript object




Objects are finished components that can be formatted as separate files and used in the future. A characteristic feature of this approach is the possibility of feedback when an updated, improved object can be used in a previous development, automatically updating its functionality without updating the site.




All Articles