Write a few Javascript Regular Expressions for Numerical verification.

I recently wrote a small Web ProgramThe format of an input value is verified, for example, whether it is a number, whether it is a positive number, or whether it is an integer. Because the input data in the input box is arbitrary, such as letters

7 JavaScript differences between FF and IE

Although the history of using lengthy and annoying code blocks in JavaScript to mark specific browsers has ended, however, it is necessary to occasionally use some simple code blocks and object detection to ensure that some code works normally on

Example of a JavaScript Regular Expression

! Remove spaces at both ends of a string If you use the traditional method, you may need to use the following method.// Clear spaces on the leftFunction js_ltrim (deststr){If (deststr = NULL) Return "";VaR Pos = 0;VaR retstr = new string (deststr

Two useful Javascript tool Functions

1. You can write various assignment statements in your work.For example, the most common obj. style. display = "none ";If there are more than one assignment statement, obj. style will be dizzy in a row. The following extend functions in my base. js

[JS Code] using JavaScript to implement webpage rotation advertisement Effect

Http://www.webjx.com/htmldata/2005-11-26/1132968209.html) Demo: http://www.webjx.com/htmldata/2005-11-26/test.html  

Tips on javascript

Original: http://topic.csdn.net/u/20100421/16/817ef7c6-6675-49e1-bf39-b4a96c08b41e.html 1,Convert string to numeric value General MethodCode: Var a = parseFloat ("12 "); Var B = parseInt ("34 "); AvailableCode: Var a = + ("12 "); Var B = + ("3

Javascript-based formula interpreter-14 [Cell Object]

Cell Object File: Cell. js // JScript source code var $ MIN_ROW = 1, $ MAX_ROW = 65535, $ MIN_COL = 1, $ MAX_COL = 256, $ COL_STEP = 26; // -------------- Cell --------------- function Cell (addrStr, absoluteAddr) { this. set_ClassName ("Cell"

Javascript-based formula interpreter-5 [Implementation of The unary operator]

OperatorUnaryBase unary operator base type File: OperatorUnaryBase. js Function OperatorUnaryBase () { this. deriveFrom (new OperatorBase (); this. set_ClassName ("OperatorUnaryBase"); this. _ type = new UnaryType ("undefined"); };

JavaScript-based formula interpreter-4 [implementation of the operator base type]

Operator priority Definition File: OperatorBase. js // JScript source code var $ OperatorPriority = { // Logic "|": 0, "&": 0, // Compare ">": 1, "> =": 1, " " // Logic compute "|": 2, "&": 2, "^": 2, // Mathematic "+": 3, "-": 3, "*":

JavaScript-based formula interpreter-7 [Implementation of Arithmetic Operators]

Arithmetic Operators include +,-, *,/, and %.   Arithmetic Operators File: OperatorMathematic. js Function OperatorMathematic () { this. deriveFrom (new OperatorBinaryBase (); this. set_ClassName ("OperatorMathematic"); this. set_Sign ("undefined")

JavaScript-based formula interpreter-8 [comparison operator implementation]

Comparison operator base class File: OperatorCompareBase. js Function operatorcomparebase () { This. derivefrom (New operatorbinarybase (); This. set_classname ("operatorcomparebase"); This. set_sign ("operatorcomparebase"); This. _

JavaScript for snake games

Thank you for your comments and suggestions! greedy JavaScript greedy snake By Zhang Bing

Simulate string. Format string combinations in javascript

Character string combinations are often used during software development. Let's take a look at a common character string combination: Var strName = 'zhang san '; Var strTableName = 'mytable '; Var strSql = "select * from" + strTableName + "where

Javascript check Username

Function checkuser () { VaR OBJ = Document. getelementbyid ("checkuser "); VaR STR = Document. getelementbyid ("txtusername"). value; OBJ. classname = "right "; OBJ. innerhtml = 'checking. Please wait ...'; If (Str. Length = 0) { Checkuser = "false "

Javascript checks the password and verifies the password twice.

 Function CheckPsw () ...{ Var p = document. getElementById ("TxtPsw"). value; If (p. length = 0) ...{ CheckPsw = "false "; SetCheckPsw (checkPsw ); Return; } Var Expression =/^ [A-Za-z0-9] + $ /; Var regExp = new RegExp (Expression ); If (regExp.

Javascript check email

Function checkemail () ...{ VaR OBJ = Document. getelementbyid ("checkemail "); VaR email = Document. getelementbyid ("txtemail"). value; OBJ. classname = "right "; OBJ. innerhtml = 'checking. Please wait ...'; If (email. length> 0) ...{ VaR

The curl translation URL is a unicode Code and is parsed by the JavaScript code at the front end.

When the query string is used in the url, the square question is translated and some related information is checked. Basically, the server that uses js is used. encode (); server. decode (); Use the url for sending and receiving

A timer written in Javascript

Write a javascript timer Requirement: Write a javascript timer: it shocould alert a diert after certain timer, the dialog has two buttons. click one of them, the page will refresh automatically; click the other, nothing will happen. Deploy it on

JavaScript: dynamic binding of Button events

Based on prototype. js, v1.6 It is hard to understand how to dynamically bind events to elements. I found the bind method on the Internet, and it is difficult to understand when the dynamic binding method needs to add parameters.Using this method

Dynamic introduction of JavaScript

VaR JS = Document. createelement ("script "); JS. ID = "tmpjs "; JS. src = "/prototype. js "; Document. getelementsbytagname ("head") [0]. appendchild (JS ); In this way, if alert (prototype) is enabled immediately, the prototype is undefined.

Total Pages: 5378 1 .... 2700 2701 2702 2703 2704 .... 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.