Functions: Prototypes
Each constructor has a property called a prototype (prototype, which is no longer translated, uses its original text). This property is useful: declaring a generic variable or function for a particular class.
Definition of
Example 1In JS, the JSON-formatted string is converted to a JSON object, and the key code
Copy Code code as follows:
JSON = eval (' (' +str+ ') ');
The method is as follows:
Copy Code code as follows:
json
Example
If you click the mouse on the D3, the event flow is this:
The capture phase detects whether an event handler with Usecapture is true at Div1 and, if so, executes the program and then processes the DIV2 again.
Target phase at Div3, found
First, form elements if the value of the JS assignment is refreshed, the record is the value of JS assignment, not the initial value
Second, non-form elements if you use JS assignment refresh, the record is the initial valuewwww
In JS we can not be as direct as PHP to judge a value or string in the array using In_array to achieve, because JS does not have in_array function, but we can customize to JS write a In_array function, the following I collected a few.
Example 1
Target: Select item, its font is set to #3197ff, unchecked, its font is #ffffff
As with Listvew setting select row Item background picture, use selector, but the color setting here should be set in TextView in ListView.
Copy Code code as
The GridView and ListView are more commonly used multiple control layouts, and the GridView is the first choice to achieve nine map! This article describes how to implement the nine diagram using the GridView. There are many uses of the GridView,
This article illustrates the thinkphp implementation of Memcache distributed caching function. Share to everyone for your reference, specific as follows:
Two days after studying the issue of memcache distributed caching, it was found that thinkphp
An ordinary Javascrip function with only one entry parameter
Copy Code code as follows:
function test (info)
{
alert (info);
}
Page is generated with ASPX code, the entry parameter that invokes the test function may be
When I upload a thumbnail, the thumbnail shows a link to the following image;
Copy Code code as follows:
The result does not show the thumbnail in IE6, and then goes back to the following code:
Copy Code code as
One, template call For example, in a template, to invoke the contents of another template, you can use the following statement:{Template XXX}Suppose that a new template was established named "Abc.htm", inBackgroundTemplate editing will only appear
Use of this in JavaScript
This variable is an elusive keyword in JavaScript, and this is very powerful, and knowledge of this is helpful in helping us to write object-oriented JavaScript programs.
The most essential thing for this variable is to
In an HTML page, visual elements such as buttons, text boxes, and so on, have events that hold and lose focus, which can fire a preset action when responding to a mouse or keyboard action. This article takes the text box obtains and loses the focal
Copy Code code as follows:
And look at the HTML code.
Copy Code code as follows:
Implementation of the effect is such, I do not know whether we can understand, in fact, is the first set the
As you know, Json_encode usually escapes the Chinese characters in JSON to Unicode, but that's not necessarily what we want. Sometimes we need to get a JSON string of Chinese characters, such as a JSON string that needs to be GBK encoded (as long as
Observer pattern,have been using, but do not know what is the Observer pattern. To see an article about the observer pattern, it is plainly that an object (the observer) holds a reference to a bunch of objects (the observer), which are placed in a
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service