A few JavaScript gadgets (original)

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

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

Common JavaScript functions (ii)

/********************************************************************************* * Eo_jslib.js * JavaScript Regular expression test **********************************************************************************/ The checksum is all made up of

Using JavaScript to implement time-period queries

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

JavaScript With Statement Learning

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

An introduction to the TextRange object of JavaScript and its using method

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

JavaScript regular matching full-width or half-width symbols

The effect is as follows js Regular matching Chinese punctuation    

Writing asynchronous JavaScript tests using generator

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

An in-depth analysis of event delegation mechanisms in JavaScript

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

JavaScript disables browser back button implementation code

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

The JavaScript map () function converts all array elements to uppercase

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

Javascript gets the scroll bar position

cos

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

JavaScript Sliding-folding Menu Implementation code

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.

How to get nodes by using ID in JavaScript

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

Example of how to judge the validity of variables in JavaScript

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

Very common and practical 10-segment JavaScript code

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.

Examples of Javascript Web-based WeChat sharing

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

JavaScript callback functions

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

JavaScript Tutorial: onmouseover controls images

JavaScript Tutorial: onmouseover controls images This article is from: Web teaching Network ()

Examples of simple Javascript code application on web pages

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

Total Pages: 5378 1 .... 2240 2241 2242 2243 2244 .... 5378 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.