JS front-end
Code Some encrypted JS such as JScript. encode has been cracked for a long time because it must be parsed in IE plain text. There are also some encryption methods, through complex transformations, to change the source code, but
Another decryption process in Javascript, recommended, will basically solve this a lot
[General preparation]
1. First try to masterCode.
This requires some experience. The first step is to do what Hutia has done (although this step can be
// History
//------------------------------------------------------------------
// Jan 23,200 4: fixed problems which caused the script not to work in
// Some framed situations. Improved browser support.
// Added easier "addhandle" implentation.
//
In the subconscious, JavaScript will not be written using object-oriented ideas.
Code And seldom learn more about prototype, closures, and other concepts. This leads to poor code writing.
The most important thing to learn about Javascript is to
String connection
1. Most Commonly Used + =
I always said that the efficiency of this method is the lowest. Why? Let's take a look at the substantive process of this method.
VaR STR = "hello ";
STR + = "world ";
(1) create a string that stores
CopyCode The Code is as follows:
1. Create an object using JSON in Javascript JS CodeCopy codeThe Code is as follows: // create an empty objectVaR jsonobject = {}// Create a new objectVaR jsonobject = new object ()// Create an object that
The day before yesterday, I spent a while and sent an article [one line of code to easily handle the quick message function]. At the same time, I released the quick message function and source code of v1.0beta.
Code The reason for beta is that
JSON rules are simple: the object is an unordered set of 'name/value' pairs. An object starts with "{" (left parenthesis) and ends with "}" (right Parenthesis. Each "name" is followed by a ":" (colon); "," (comma) is used to separate the "name/value"
I did not perform the test. For reference only
Code
Copy code The Code is as follows:
News test 1 News test 1
News test 2 News test 2
News Test 3 News Test 3
News test 4 News test 4
News Test 5 news Test 5
News Test 6
Policy & capture It is too easy to implement policy and capture. We only need to save the handler passed by capture, and then find the matched handler in policy.
CopyCode The Code is as follows: var filterhandlerbundles = [];
Dispatch. Capture =
This article details the methods and principles of various function calls in Javascript, which is helpful for understanding JavaScript Functions!
JavaScript: five methods to call Functions
Again and again, I found that Javascript code with bugs is
Today, when studying a system, we found that its code has such a structure (simplified ):
Copy codeThe Code is as follows: var result = false;
Point:
{
Var obj = {key: 1 };
For (var key in obj ){
//...
Break point;
}
Result = true;
}
However, to implement some specific functions, you can select a lightweight library with more specific functions. This article will share with you 16 useful JavaScript libraries today.
Blackbird: Open Source JavaScript Logging UtilityBlackbird is a
Note:
Lexical scope: the scope of a variable is determined during definition rather than execution. That is to say, the lexical scope depends on the source code and can be determined through static analysis. Therefore, the lexical scope is also
The following describes how to handle and debug JS errors.
Method 1: Use the alert () and document. write () methods to monitor variable values.When the variable value is displayed in the pop-up dialog box, alert () stops running the code until the
1. Compile js Functions
2. Add the id attribute to the html element to be displayed/hidden
control the display/hide of this tr
3. Add buttons and links to trigger js functions.
display/hide
Javascript hide layer advertisement
2. Two
JavaScript: JavaScript enables proportional scaling of webpage images. For the Javascript tutorial, refer to some code and write a script for Image Scaling. You can click to zoom in and use the mouse wheel to scale freely. // scale the image
Javascript: select all the checkbox columns of the datagrid client, invert selection, Javascript tutorial
Simplest format: This is a clever method, but it is not universal. The premise is that this page has only one datagrid and only the datagrid
JAVAScript: Page self-adaptation through JAVAScript. Javascript tutorial
Sometimes, we may need to make some data display blocks adaptive according to the page size like the new Yahoo Mail. The fact is not difficult, but if we simply use CSS control,
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