IE compatibility is not handled, exactly say not very will, also hope pointing twos
Ideas:
1. JS Gets the button group object to give the fixed-point hit event, such as Btns=document.xxx (), to get the subscript eg:btns[i].index=i of the current
The usual methods of event binding in 3: traditional binding, the method of the common-system binding, ie binding method . However, it is important for us in actual development to need a generic, cross-browser binding approach. If we search on the
You may have overheard promises, a lot of people are talking about it, using it, but you don't know why they're so special. Can't you use a callback? What's so special about it? In this article, let's look at what promises is and how to use them to
Using global variables to save a single case
This is the simplest way to implement
function person () {
this.createtime=new Date ();
}
var instance=new person ();
function getinstance () {return
instance;
}
When the JS is
Before we discuss the bind () method, let's look at a topic:
var altwrite = document.write;Altwrite ("Hello");1. What's wrong with the above code2. What is the correct operation?How to implement the 3.bind () method
For the above question, the
Load Event
Advantages: easy to use without affecting HTML code.
disadvantage: only one element can be specified, Javascipt code must be placed below the picture element
jquery method
Note that you do not bind the Load event in $ (
Javascript arrays work the same way as arrays in most programming languages.
learn4array
When you create an array, you do not need to declare the number of elements in the array. JavaScript arrays are automatically resized to
This example for you to share the JS tab switch effect of the specific implementation code for your reference, the specific contents are as follows
Zhu Production num1 num2 num3 num4 content1 content2 content3 content4
In the hands of the site, the inevitable encounter page jump problem, the new page is open on the current page? or open it in a new window? Is it necessary to jump according to the parameters or to be confirmed by the user and then jump? And so many
ke physical and chemical function thought: A JS pre-processing idea; using function execution can form a principle of not destroying scopes, storing what needs to be processed in this not-destroyed scope, and returning a small function, after which
Math.Abs (x): The absolute value of the number that can be returned
Math.ceil (x): Rounding up
Math.floor (x): Rounding Down
Math.max (x,y): Max value
Math.min (x,y): Minimum value
Math.random (x): Random number
Math.Round (x): Rounding
Gets
Exec is the method of a regular expression, not a string method, and its arguments are strings, as follows:
var re=new RegExp (/\d/);
Re.exec ("Abc4def");
Or use Perl style:
/\d/.exec ("Abc4def");
Match is the method provided by the
Confirm () Means confirmation box
confirm
Prompt message Prompt box
confirm
window.open (uri,name,attr)
confirm
Click me
Window.close () Close window
The above is a small
The example in this article describes the way JavaScript uses settimeout to implement a deferred pop-up warning box. Share to everyone for your reference. Specifically as follows:
First to show you a delay/timing/forced pop-up window of the JS code
Here are some tips I've summed up, just for reference.
The following code is basically in the jquery source can be seen, if the wrong place, please point out.
Use the source method as much as possible
JavaScript is an explanatory language and is
typeoftypeof use more time, is to judge a global variable in the absence, if a page defines a global variable. If you make the following judgments:
Haorooms is a global variable
if (haorooms!=undefined) {
}//js will complain, saying
Examples of this article for you to share the JavaScript processing form events commonly used methods for your reference, the specific contents are as follows
1, access to the form objects commonly used methods:
①: Based on the id attribute of the
Look at the first step of jquery source code, for the creation of jquery object to see the fog, pondering half a day finally a little feeling, in this record
The first way:
var A = function () {return
a.prototype.init ();
}
A.prototype =
The importance of arrays in programming languages is self-evident, and in JavaScript, arrays are one of the most commonly used objects, arrays are ordered collections of values, and because of the weak type, the arrays in JavaScript are flexible and
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