Add the following code to the front of the JavaScript
Copy Code code as follows:
/* @cc_on _d=document;eval (' var document=_d ') @*/
To join such a line of code IE's document access speed can be increased by at least 5 times
The Ancients have "given the fish, as the award of the fishing", without teachers, they can only learn "fishing". Let's start with a simple one!
The following code is the most familiar, but do you know why it's written? Why add this code to the page,
Yesterday, with the jquery plug-in aeimageresize, found that it has more advantages: each picture after loading, will be immediately to zoom.
This is attributed to the loading event of image object image onload.
View the source of the plug-in, found
1. Avoid using eval or function constructors
2. Avoid using with
3. Do not use try-catch-finally in functions that are critical to performance requirements
4. Avoid using global variables
5. Avoid using for-in in functions that are critical to
In the process of writing a program, you often encounter the need to remove duplicate elements from an array. It is not difficult to implement this function.
We can do this with a double loop, and for small arrays, that's certainly not the case.
But
Copy Code code as follows:
In IE, there are sometimes "unknown run-time errors" (Unknown runtime error), but not in Firefox.
This is mainly the case of IE in the write operation of the innerHTML will check whether the element has to
Caller:
Functionname.caller returns the caller.
Take a look at the following function, you can copy it to vs under Execute
Copy Code code as follows:
function caller () {
if (Caller.caller) {
Alert (caller.caller.toString ());
Example 1:
Copy Code code as follows:
var obj={0: ' A ', 1: ' B '}
alert (obj.length); Undefined
var arr=[' A ', ' B ']
alert (arr.length); 2
From the example above, the length property in the class array object is not
JavaScript asynchronous programming is gradually accepted by everyone, previously we generally through callback nesting, settimeout, setinterval, etc., the code looks very intuitive, do not look at the entire code logic is difficult to quickly
1. Interface design
Index.html: Only a placeholder for the location where the wizard is displayed
Copy Code code as follows:
Gift Recommendation Guide
STYLE.CSS: By default, the wizard has a
In section 2.8.4, the substring () method and the slice () method in the string class are basically the same as the return results, as in the following example:
Copy Code code as follows:
var strobj = new String ("Hello World");
A few days ago to see a face test, the topic is this:
What do you say about Apply,call,bind in JavaScript?
It's a cliché to apply and call first, but for bind, I froze because the word was a very high frequency in jquery used to bind events to DOM
Today, there is a small problem, in the building DOM, IE can not pass Element.setattribute (' name ', _variable); and element.name = _variable; In this form, add the name attribute to the element, whether it is IE6 or IE7. (IE8 is OK, but ie8rc1 not)
The DOM Document Object model is an application interface (API) for HTML and XML, and the DOM plans the entire page as a document composed of node hierarchies. DOM objects give developers access to HTML and enable developers to process and view HTML
Introduced
In this article, we will discuss more details that are directly related to the execution context. The subject of the discussion is the this keyword.
Practice has shown that this topic is difficult, and it is often problematic to determine
First, Judge
Grammar
Prop in ObjectName
The In operator returns true if the object that the objectname points to contains prop this property or a key value.
Copy Code code as follows:
var arr = [' One ', ' two ', ' three ', ' four ']
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