JavaScript Universal Library

zhaozj2021-02-16  100

JavaScript can play a big role in web programming, write some common functions into a JavaScript class library.

Save the following code as common.js

Class library function:

Trim (STR) - Remove the space between the strings

2.Xmlencode (STR) - XML ​​encoding for strings

3.Showlabel (STR, STR) - Mouse prompt function (display character, prompt character)

You can set the font, color, size, and prompt background color, border, etc.

4. IISEMPTY (OBJ) - Verify that the input box is empty

5. InterInt (Objstr, Sign, Zero) - Verify whether it is an integer, positive integer, negative integer, and whether to include zero

6.isfloat (Objstr, Sign, Zero) - Verify that it is a floating point number, positive floating point, diverted point, and whether to include zero

7. Iisenletter (Objstr, size) - Verify that it is 26 letters, uppercase small

The source code is as follows:

/ *

Name: Common.js

Function: General JavaScript scripting function library

include:

Trim (STR) - Remove the space between the strings

2.Xmlencode (STR) - XML ​​encoding for strings

3.Showlabel (STR, STR) - Mouse prompt function (display character, prompt character)

4. IISEMPTY (OBJ) - Verify that the input box is empty

5. InterInt (Objstr, Sign, ZERO) - Verify that it is an integer

6.isfloat (Objstr, Sign, Zero) - Verify that it is a floating point number

7. Iisenletter (Objstr, Size) - Verify that it is 26 letters

转载请注明原文地址:https://www.9cbs.com/read-11367.html

New Post(0)