The body of a regular expression.The regular expression uses special characters. Below I will briefly introduce various symbols and their meanings and usage (note: "X and above include X "):
/Indicates that the text after it is a special symbol. For
Functions:1. One of my colleagues asked me to implement such a function, like PHP. Input a number in the form, and then the page shows the corresponding quantity. If it is PHP, it will be much simpler, jquery is still the first implementation, so we
When you need to quickly end a currently executed jquery animation (not completed yet), such as fadeOut (), you can execute stop (true) on the object that executes the current animation;For example:Copy codeThe Code is as follows:
What is a Singleton?
A singleton requires that a class has only one instance and provides a global access point. Therefore, it is the responsibility of the designer to bypass the conventional controller so that it can only have one instance for the
Js prevents bubbling In the process of blocking bubbles, W3C and IE adopt different methods, so we must make the following compatibility.Copy codeThe Code is as follows:Function stopPro (evt ){Var e = evt | window. event;// If returnValue is set to
The search category in the Easy Search project is dynamically generated by JS, and each generated element must dynamically add attributes and events. You can assign values to attributes, which is applicable to IE and FF. For example:
Var element =
Because ie6 and 7 do not support JSON. stringify (json), we have to write another function to replace this method. The Code is as follows:Copy codeThe Code is as follows:Function JsonToStr (o ){Var arr = [];Var fmt = function (s ){If (typeof s =
A dynamic Addition MethodCopy codeThe Code is as follows:/*Dynamic Loading of js v1.0 by: dumUsage: src = "webJsBase. js? Load = a, B"Note: load the js files in the current directory.*/Var webJsBase = {Require: function (libraryName ){Document.
Jquery radio, checkbox, select, radio, checkbox, select, and relatedObtains the value of a set of radio selected items.Var item = $ ('input [name = items] [checked] '). val ();Obtain the text of the selected select item.Var item = $ ("select [name =
Many Web pages place a "Back to Top" button at the bottom of the page, especially those without navigation at the bottom of the page, which can help visitors find the navigation again or review the advertisement (think really beautiful ). As
We all know that there are two methods to iterate objects in JavaScript:(1) for Loop;(2) for... in loop;Using the for loop to iterate array objects will surely become commonplace. However, when using the for... in loop, you should pay attention to
First, clarify the purpose:
When the user enters the page, the loading icon is displayed, and the maximum image is loaded before the opacity image;
The function is very simple, but it hurts that I did not fully implement it;
At the same time, I
First:On a common web page that has been opened, click "full screen" and enter the full screen mode corresponding to the web page. Method: Add the following code between the and Of the webpage:Copy codeThe Code is as follows: If the full screen is
Generally, some methods are executed at the JS page latency. You can use the following methodsJQuery. delay () method OverviewHttp://shawphy.com/2010/11/jquery-delay.htmlQueue and dequeue usage in jQueryHttp://www.jb51.net/article/25481.htmWindow.
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