JavaScript Some common knowledge

JavaScript is pointing in this keyword

1. If the object in which: the object points

2. Use in the constructor: current object point (a point with the above)

3. The use of an ordinary function: this the global object (regardless of how many layers of nested function in general)

4.DOM element binding events: this points to element binding events

 

 

Difference localStorage, sessionStorage of

1.localStorage: no local storage time limit, unless the initiative to delete data, or never expire. Ignoring the current session, to be shared in the same domain

2.sessionStorage: for session data storage, a page any information stored in the window page under the same domain can access its stored data, the value of each window is independent, its data will be with window Close disappear, sessionStorage between different windows can not be shared.

 

Guess you like

Origin www.cnblogs.com/gao2/p/11576450.html