I have been reading the fifth edition of the javascript authoritative guide recently. The variable scope chapter is really tired. However, there are still many gains. I don't know, how do you understand the "Declaration" and "Definition" of
Extjs initializes the checkboxgroup value Code. For more information, see.
The Code is as follows:
Ext. override (Ext. form. CheckboxGroup ,{SetValueForItem: function (val) {// multiple option values are separated by commasVal = "," + val + ","
JS string Function Extension code. You can refer to the prototype usage method to expand your own string processing functions.
The Code is as follows:
/*************************************** ************** CreateBy: joe zhou* CreateDate: 2011-9-4
I have been rebuilding the workstation track playback function some time ago. At first I thought it was very simple, but it caused a series of strange problems, which made me very painful, so I had to write a summary to deepen my memory. Background:
Prototype Learning Tool functions $ H, $ R, Try. these, document. getElementsByClassName $ H are convenient methods for creating Hash objects. For details about Hash objects, refer to [Prototype Learning-Hash objects]
$ R is a convenient method for
The checked attribute cannot be correctly implemented in IE. in IE, when using checkbox or radio, you may find that the CheckBoxObject cannot be used sometimes. checked = true or CheckBoxObject. the setAttribute ('checked', true) method causes the
The Template object here is actually a tool for formatting strings, just like the String. format method in java. This object provides only one evaluate method.
The Code is as follows:
Var Template = Class. create ({// Initialization
This object is an extension of the function. The most important thing is the bind method. The wrap method is also very important, in the class inheritance mechanism, the wrap method is used to call the same name method of the parent class. This
Recently, when I was working on a project, ExtJS was used in the project. Some content should be displayed by tab. For project requirements, the tab can only be vertically distributed, but the TabPanel in ExtJS can only be horizontally displayed,
Summary of javascript Exception Handling... Catch... You can use the try... catch... finally statement to handle exceptions in finallywindow. onerror JavaScript, or manually throw an exception.
1. Use the try... catch... finally statement to handle
Javascript is a weak type language, so forced type conversion is more important. Let's take a look at several of its forced conversion functions. 1. Boolean (value): Convert the value to the Boolean type;
2. Nnumber (value): converts a value to a
The values of childNodes. length and children. length are often different. Because
ChildNodes
Not only
Html
Node
, AllAttribute,TextAre included in
ChildNodes
Inside
,
You can use
NodeType
To determine the type of node, only when
NodeType = 1
Make
Detect JS Code of various browsers and Systems
The Code is as follows:
Var sUserAgent = navigator. userAgent;Var fAppVersion = parseFloat (navigator. appVersion );Function compareVersions (sVersion1, sVersion2 ){Var aVersion1 = sVersion1.split ("."
Sometimes we need to use js to set the style attributes of the document. The following describes some methods and principles for analysis. You can see that it is okay. First, let's talk about the style sheet attributes.
1. inline style is set in the
The basic concepts of JavaScript forum post is a summary of some advanced js skills. 1. About this object
The Code is as follows:
View plaincopy to clipboardprint?Var obj1 = new Object ();Var obj2 = new Object ();// Add the property p to both
Recently, I have passed some tests to comprehensively parse the JavaScript code execution sequence of web pages in various browsers and record them here. We know that javaScript is an interpreted language, and its execution is top-down, but the
In the previous blog "Judging the current webpage display mode in IE8", I mentioned that IE has different display modes and how to use Javascript to dynamically determine. Web developers can import different content according to different display
Today, I am launching a piece of Obfuscated javascript code, because the source code is lost... I was planning to get the code at the js engine level and found that it was not necessary at all. Manual decryption is much simpler than imagined. It
1. Keep it non-invasive and mark the JavaScript code You Don't Want To Know; 2. prohibit modification and extension of Object. prototype !; 3. the fewer extensions of JavaScript built-in objects, the better. 4. follow the standard; 5. or follow the
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