---
title: "检验是不是数字"
author: "3806850"
date: "2011-06-14T14:45:22Z"
tags: ["J#", "QQ"]
categories: ["非技术"]
slug: "untitled"
draft: false
lastmod: "2011-06-14T14:45:22Z"
id: 1087459
url: "https://3806850.iteye.com/blog/1087459"
---

 


function ss(){

var account="ss";

 var qq = fucCheckNUM(account);
        if (qq == 0) {
        
            window.alert("account不是数字！");
            return false;
        }

}




function fucCheckNUM(NUM){
    var i, j, strTemp;
    strTemp = "0123456789";
    if (NUM.length == 0) 
        return 0
    for (i = 0; i < NUM.length; i++) {
        j = strTemp.indexOf(NUM.charAt(i));
        if (j == -1) {
            //说明有字符不是数字
            return 0;
        }
    }
    //说明是数字
    return 1;
}