完整的JavaScript版的信用卡校验代码完整的JavaScript版的信用卡校验代码
1 function isValidCreditCard(type, ccnum) { 2 if (type == "Visa") { 3 // Visa: length 16, prefix 4, dashes optional. 4 var re = /^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/; 5 } else i...