Vs2008 environment, first
Common. js
CopyCode The Code is as follows: var common = {
Trim: function (STR) {return Str. Replace (/(^ \ s *) | (\ s * $)/g ,"");},
Isnumber: function (STR) {return/[\ d | \. |,] +/. Test (STR );},
Isemail: function (semail) {return/^ \ W + (-\ W +) | (\. \ W +) * \ @ [A-Za-z0-9] + ((\. |-) [A-Za-z0-9] + )*\. [A-Za-z0-9] + $ /. test (semail );}
}
Function checkradio (radioid ){
VaR result = false;
VaR radio = f (radioid );
For (VAR I = 0; I <radio. length; I ++ ){
If (radio [I]. Checked ){
Result = true;
Break;
}
}
Return result;
}
Util. js
var common = {
trim: function (STR) {
///
// remove two-side spaces
///
/// characters to be spaces
// string
},
isnumber: function (STR) {
///
// determines whether it is a numerical value.
///
/// Verification character
/// bool
},
isemail: function (semail) {
///
// determines whether it is an email.
///
/// email character
// bool
}< BR >}< br> function checkradio (radioid) {
///
// whether at least one
///
// radionid
// bool
}