Take the remainder in JS
0%401%412%423%434%405%41
Example
Gets the day, hour, and minute contained in minutes, based on the number of minutes
function Getcosttime (minutes) {var day=parseint (minutes/1440);var hour=parseint (MINUTES/60);var
The Boolean value true represents True and false for false. The generic relational operator returns the result of a Boolean value. In addition, values of 0,-0, NULL, NaN, undefined, and null characters ("") of special values are interpreted as false,
Let's look at a jquery drag-and-drop effect, as long as the monitoring MouseDown and MouseMove MouseUp is OK, see the example below
The code is as follows
Copy Code
Drag Tests if invalid, please refresh the next page.
Say nothing more, directly on the code, see the original author comments go, uh ...Static private variables
The code is as follows
Copy Code
var mynamespace = {}; Defining namespaces Mynamespace.treeitem = (function () {
Web effects load XML document functions
I checked the JavaScript Authority guide, looked at some of the writing on the web, and then sorted out a loaded XML function that was in principle fully compatible. After my test are: ie6/7/8,ff (geckos),
1. When the number of actual parameters does not match the number of formal parameters, no error is caused.If the actual parameter value is too high, the parameter value that is exceeded is ignored, and if the actual parameter value is too small,
1. CSS Tutorial "float" valueThe most basic syntax for accessing a given CSS tutorial value is: Object.style.property, using the hump to replace a value with a connector, for example, to access a Background-color value with the id "header". We use
This paper illustrates the method of realizing network monitoring by JavaScript. Share to everyone for your reference. The implementation methods are as follows:
The code can monitor whether the network connection and speed of the state.
1. The biggest feature of JavaScript is its flexibility. As a front-end developer, either functional programming style or a more complex object-oriented programming style can be used. No matter which style you use, you can accomplish some very
A regular expression is an object that describes a character pattern.
First of all, this article is not directly to tell you, what is the regular expression URL, and how to use this regular expression to parse a URL address, I believe that this
Take a look at this example:
Copy Code code as follows:
var a = ' global ';
(function () {
alert (a);
var a = ' local ';
})();
The first thing you see in this example is what does the output look like? ' Global '? or
When a JS object is generated:
such as: function BB (a) {This.a= "KKK"}
var b=new BB ();At this time B is the object has the BB attribute prototype to the prototype object;The prototype object has a constructor attribute pointing to the BB
There is no concept of namespaces in JavaScript, but to embody object-oriented thinking,
There should be a namespace, just like the namespace in Package,.net in Java,
The main function is to prevent class name conflicts, the same class name as long
Recently received a project, project requirements need to use JS Regular expression filter out page text field is worth double quotes, in fact, the solution is very simple, the following I write the code to share with you, have the same needs of
The first method:
In the user registration page Some requirements are more stringent, need to verify the identity card JS is legitimate, through this function strictly this system software, thus filtering to many water passengers. Here's how to
The project needs to use the calendar,. NET calendar control is too heavy, had to write with JS, the core function of the calendar is DateAdd (), the writing process found in JS inside operation time than the imagination of tedious, not like
ObjectiveThis article is my Learning JavaScript process in the collection and collation of some of the error-prone knowledge points, will be from the scope of variables, type comparison, this point, function parameters, closure problems and object
Canvas achieves the bean fish effect, while canvas draws the bean fish
For more information, see the code:
canvas fish beans Angle to radian: radians = 2 * PI * angle/360 = angle * PI/180
The above is all the content of this article.
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