The code is as follows
Copy Code
Detection code:
The code is as follows
Copy Code
if (Detectunitywebplayer ()) {//New check unity is installed added by Shanmao 2014–3-29Alert (' Test detection
Scene:JS determines whether a string is in an array of JS.Method:
The code is as follows
Copy Code
if ([' A ', ' B ', ' C '].indexof (str) >= 0) {Do something}
Determines whether the name of the selected file
JavaScript is a weakly typed language, and the system iterates through the JSON data to sort by its own data type, as follows:
The code is as follows
Copy Code
How to sort JSON data by a specified sort:
JS Code
The code is as follows
Copy Code
/*** Countdown function* Need to bind the button to the Click event* such as: * 30 represents the number of seconds, the number of seconds to be counted can be changed*/function
Mailbox Format Verification---------------------------------------
The code is as follows
Copy Code
Function Name: ChkemailFunction Introduction: Check whether for email addressParameter description: The string to
Mailbox Verification
The code is as follows
Copy Code
var re =/^[_a-za-z0-9-.] +@ ([-_a-za-z0-9]+.) +[a-za-z0-9]{2,3}$/;if (!thisinput.value.match (re)){Regemailinfo.classname = "Show err";regemailinfo.innerhtml = "Input
/*Function: Modify Window.settimeout so that it can pass parameters and object parameters (also available for setinterval)How to use: settimeout (callback function, time, parameter 1,..., parameter n) (FF has native support, IE does not support)*/
/**//*Features: Statistics, removing duplicate characters@param str needs a string of statisticsDescription: Often used in string repeating characters, or in the array of repeated letters, numbers and so on count.This collection of two typical types
The code is as follows
Copy Code
Date.prototype.format = function (format){var o ={"m+": This.getmonth () +1,//month"D+": This.getdate (),//day"h+": this.gethours (),//hour"m+": This.getminutes (),//minute"S+": This.getseconds
It is easy to create an object in JavaScript. You can use the object literal or constructor. Common Object creation modes include:I. Factory modelThe factory mode abstracts the process of a specific object and uses functions to encapsulate the
In WEB development, the concept of routing is no stranger. We are exposed to frontend routing and backend routing. Backend routing is an important module in many frameworks, such as Thinkphp and Wordpress. It applies the routing function to make the
When we see links on other people's web pages that enable, print, forward, save as, back, close this window, disable right-click, and so on to implement browser commands, are you sorry? Do you also want to implement it? It would be interesting to
I made a webpage navigation drop-down menu, which can be quickly generated using firework. I only need to copy the code to the page. However, different resolutions on the user end lead to the movement of the drop-down menu position, how to keep the
// The page is displayed, and the following tasks are performed on them. The following are all front-end javascript functions. Step 1: generate the option value of selCategory in the selection box based on the array aCategory in the window. onload
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