ObjectiveIn this chapter, we are going to explain the 5th of the S.o.l.i.d Five principles of JavaScript, which relies on the inverted principle LSP (the Dependency inversion Principle).English Original: http://freshbrewedcode.com/derekgreer/2012/01/
First, document.getElementById () Gets the element node according to the ID; I'm the first one to p.I'm a second p.Window.onload = function () {var str = document.getElementById ("P1"). InnerHTML;alert (str); Pop up I was the first P}Second,
hasOwnProperty: is used to determine whether an object has a property or object that you give a name to. However, it is important to note that this method cannot check whether the object has this property in its prototype chain, and that the
1. Basic create "class" modevar Class = function () {var Klass = function () {this.init.apply (this, arguments);}; Klass.prototype.init = function () {};return klass;}; var person = new Class (); Person.prototype.init = function () {//Initialize the
After a period of time, now begin to look at chapter 8th.8th chapter: BOMThe BOM provides many objects for accessing the functionality of the browser. The core object of the BOM is window, which represents an instance of the browser . The Window
Array: ArraysPush: Adds a value to the end of the array, which can be one or more.Alert (Arr.push (4, 5))Join: Connect an array element with a delimiter in the middle.var str = arr.join ("");alert (str);Reverse: The order of the points to the array
For the north wind Nets Li Tinghui teacher's JavaScript video is really drunk. The overall structure of the video is clear and the content is relatively simple. JS is a flexible, open language, grammatical rules are not so rigid, it is easy to
Set Map Road (it is very useful for JSON fulfillment)var a = {};a["Key1"] = "value1"; a["Key2"] = "value2";Since it's a map, there's a way to retrieve the existence of a key. Write like thisif ("Key1" in a) { //something} else { //Something else}
I. Rules of grammar1. The variable must start with a letter, an underscore (_), or a dollar ($) symbol.2. You can then use any number of English letters, numbers, underscores (_), or dollar ($) characters.3. Cannot use JS keyword and reserved
in the previous article about we mentioned the concept of closures in the JavaScript this keyword article. closures are functions that have access to variables in another function scope. The ability to access external variables (references, updates)
First, introductionECMAScript contains two different types of values: primitive type values and reference type values. A primitive type value refers to a simple data segment; a reference type value refers to an object that consists of multiple
drossGlobal VariablesIt is well known that global variables may be convenient in very small programs, but as programs become larger, global variables will be difficult to handle, and global variables will reduce program reliability.There are 3 ways
The more experienced a programmer is, the easier it is to work, but do you still remember the road when you came? Let us review, those years we have learned the JS node knowledge, the road long its repair far XI, I will go up and down and quest!Each
The id has a higher priority than the style. The id has a higher priority.
The priority of the id is high or the style priority is high:We all know that the id selector has a higher priority. styles directly written in the label also have a very
Custom form style checkbox and radio, form checkboxradio1. Cause
Recently, we have to implement a custom radio style in our work, and we usually use the default style, because we can't think of a solution, so we began to search, finally, we saw a
The method of JavaScript to achieve the typing effect, and the javascript typing Effect
This example describes how to implement the typing Effect of JavaScript. Share it with you for your reference. The specific implementation method is as follows:
Best practices for javascript Simulation
1: how to simulate a class
Define a class and a new class object in the sencha touch2 series.
Ext. define (Animal, {config: {name: null}, constructor: function (config) {this. initConfig (config) ;}, speak:
JS method for obtaining the display value of the drop-down box and determining the single-choice button, js single-Choice
This article describes how to get the display value of the drop-down box and determine the single-choice button in JS. Share it
What should I do when a newbie encounters problems using the JS library?
See the title for details. During website creation, we will actually use a lot of JS libraries, popular on the Internet, and encapsulated by the company itself. These things
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.