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
Author: Shenwan