1. traverse all the controlsFunction findControlAll (){Var inputs = document. getElementsByTagName ("input ");For (j = 0; j If (inputs [j]. type = "text") // you can find all the controls whose types are text, or set them to the control type you
After a long time, the program uses the jquery load method for the request. It is strange that the second request cannot be sent. Baidu, but I know that load is requested in get mode, so IE
It is cached. I searched for a lot of solutions on the
As we all know, the execution environment of JavaScript is single-threaded. The so-called single-threaded task can only complete one task at a time, and the scheduling method of the task is queuing, which is the same as waiting at the gate of the
JavaScript itself does not determine whether a variable is a null value, because the variable may be of the string, object, number, boolean type, and other types, and the judgment method is also different. So I wrote a function in the article to
It mainly uses the timer principle, bind, trigger application, etc.Copy codeThe Code is as follows: Implementation of banner switching 1 2 3 4 5 The effect is as follows:
Recently, I want to present a product. Because there are many products that cannot be displayed on a single screen, it is not easy to find a few items on the Internet, in the end, you can only write it by yourself.
The effect is as follows:Simple
Requirement: complete adding, deleting, modifying, and copying nodes.Methods and attributes used:1. Obtain the parent node of a nodeParentNode attributes2. Obtain the subnode set of a nodeChildNodes attributes3. Create a New NodeThe createTextNode
Preface first, I declare that the method is based on some information on the Internet, such as the leap year, such as the day of the week on the first day of each month. If you don't talk too much about it, you can split the functions and try to
The bind () method is used to attach a handler to an event of each Matching Element and return the jQuery object.
. Bind (eventType [, evnetData], Handler (eventObject ))
The eventType parameter is a string that contains one or more javaScript event
The sample code in IE6 is as follows:Window. opener = null;Window. close ();
The sample code in IE7 is as follows:
Window. opener = null;Window. open ("", "_ self ");Window. close ();
To display in full screen (remove IE Toolbar, address bar, and
Tags made our textBold!
tags made our text Italicize!
On the first line. This tells the browser what language it's reading (in this case, HTML ).2. B Always putOn the next line. This starts the HTML document.2. c Always putOn the last line. This
1. margin can also be used for translation. Its function is similar to translate haha. After an element is set to absolute, you can use margin to translate it at will. It does not occupy space as relative does, nor does it need to set relative for
Shift:Delete the first entry of the original array and return the value of the deleted element. If the array is empty, return undefined.Var a = [1, 2, 3, 4, 5];Var B = a. shift ();
Result a: [2, 3, 4, 5] B: 1
Unshift: add the parameter to the
1. js does not have trim functions, but you can writeCopy codeThe Code is as follows:Function trim (str ){Var newStr = str. replace (/^ \ s * $/g ,'')Retrun newStr;} 2. Remove spaces between the left and right sides of the string. trim, ltrim, or
Solution 1: using the two functions of closures, You can flexibly read internal variables. Second, you can keep these variables in the memory.
Copy codeThe Code is as follows:// Solution 1Var SingletonTester = (function (){// Singleton
Details determine success or failure! The significance of browser cache is to improve the execution efficiency, but it also brings some problems. As a result, the server modifies js and css, and the client cannot updateMethod 1 generate random
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