JavaScript can play a big role in web programming, writing some of the most common features into JavaScript libraries.
Save the following code as Common.js
Class Library Features:
1.Trim (str)--Remove the spaces on either side of the string
2.XMLEncode (str)--XML encoding of strings
3.ShowLabel (STR,STR)--Mouse prompt function (display character, prompt character)
You can set the font, color, size, and hint background color, border, and so on for the text displayed
4.IsEmpty (obj)--Verifying that the input box is empty
5.IsInt (Objstr,sign,zero)--verifies if it is an integer, a positive integer, a negative integer, and whether it includes 0
6.IsFloat (Objstr,sign,zero)--Verify that the floating-point number, positive floating-point, negative floating-point, and whether to include 0
7.IsEnLetter (objstr,size)--Verify if 26 letters, small capitalization
The source code is as follows:
/*
Name: Common.js
Function: Generic JavaScript script function library
Including:
1.Trim (str)--Remove the spaces on either side of the string
2.XMLEncode (str)--XML encoding of strings
3.ShowLabel (STR,STR)--Mouse prompt function (display character, prompt character)
4.IsEmpty (obj)--Verifying that the input box is empty
5.IsInt (Objstr,sign,zero)--Verifying whether an integer
6.IsFloat (Objstr,sign,zero)--Verify that it is a floating-point number
7.IsEnLetter (objstr,size)--Verify that it is 26 letters
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.