Several writing and hints of asp.net Javascript-practical skills

Source: Internet
Author: User
Vs2008 environment, the above picture is first

Common.js
Copy Code code 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) {
<summary>
Remove two-side spaces
</summary>
<param name= "str" > characters to go to spaces </param>
<returns>string</returns>
},
Isnumber:function (str) {
<summary>
Judge whether it is a numeric value.
</summary>
<param name= "str" > Validation characters </param>
<returns>bool</returns>
},
Isemail:function (semail) {
<summary>
Determine if it's an email.
</summary>
<param name= "Semail" >email characters </param>
<returns>bool</returns>
}
}
function Checkradio (radioid) {
<summary>
Have you selected at least one
</summary>
<param name= "Radioid" >RadionID</param>
<returns>bool</returns>
}

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.