Determine if the date type data
function IsDate (dateval)
{
var a1=dateval.replace (/-/g, "/");
var dd=new Date (A1);
var ss=dd.getyear ();
if (isNaN (ss))
return false;
Else
return true;
}
Keep the decimal point precision, found that some versions
History object for JavaScript
The history object is the property of the Window object, and the History object has no events, but there are four properties as follows:
The URL of the document currently displayed in the current window
Lengh it
/*********************************************************************************
* Eo_jslib.js
* JavaScript Regular expression test
**********************************************************************************/
The checksum is all made up of
Later, if the time to do a query on the convenience, but is a bit more procedures, hehe!
I hope you can help me test, the input time format is 1999-01-01 or 2000-10-01 or 2000-10-10, that is, the month and time must be two, in order to facilitate
Syntax format
With (object instance){code block}
Sometimes, I'm in a program code, many times you need to use an object's properties or methods, as before, are passed: Object. Property or object. method to obtain the object's properties and
The TextRange object is an advanced feature of Dynamic HTML (DHTML) that can be used to implement many text-related tasks, such as searching and selecting text. The text range allows you to selectively select characters, words, and sentences from
Mocha is a very good test framework for Javascript/nodejs, which natively supports synchronous and asynchronous testing, but asynchronous testing, because of the explicit invocation of the done (), can easily cause asynchronous code callback to be
With the complexity of DOM structure and the application of dynamic scripting techniques such as AJAX, event delegates naturally surfaced. jquery provides the. bind (),. Live () and. Delegate () Methods for binding and delegate events. On the basis
The JavaScript code to implement this feature is as follows:As shown:
The code is as follows
Copy Code
Similarly, this method is effective, but far from the "best method". Then I saw someone suggest using
Grammarvar Mappedarray = Array.map (callback[, Thisobject]);Parameter descriptionCallback: The callback function to execute for each array element.Thisobject: This object that is defined when the callback function is executed.
Function
The code is as follows
Copy Code
All right, we got a primer on it. Returns a function of top, basically similar.
The code is as follows
Copy Code
Here are the CSS and calling methods
First look at the effect,
It's like backstage operation, okay, let's look at the example method
JS code is as follows
The code is as follows
Copy Code
Okay, now let's call this collapse menu method.
In current webpage development, the element ID attribute may only be used for searching elements in JavaScript, because it cannot be used repeatedly and violates the CSS coding principles, however, we have recently seen some alternative use.When
The JavaScript language is not strictly designed, and sometimes it is easy to confuse people. For example, the effectiveness of this variable is determined.Here are several examples:To understand why the above results are obtained, you must first
AvaScript is becoming more and more popular. It has become the first choice for front-end development. With NodeJS based on JavaScript, we can also develop high-performance backend services, I even saw JavaScript in the hardware programming field.
I had previously encountered the WeChat sharing function in the project, and I sorted it out myself. The specific code is as follows:The sharing feature is different from the sharing feature of the app, but the sharing feature is limited. You cannot
Js callback functions can be used in the following three ways,1. Direct callback2. call callback3. apply callbackThe callback function works properly to reduce code redundancy and enhance code readability, making code maintenance much easier.What
When you click an image (Image or table element) on the left of the table and move it to the center of the table:Reference content is as follows:The file is referenced as follows:Reference content is as follows: Xp style menu effectReference
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