In web design, when the user registers information, it is usually necessary to obtain the user's email address and verify its legality. The following functions can better achieve the above needs. This function writes a separate JS file to provide different page calls.
[Filename]: chK_EMAIL.JS [CODE]: function chK_EMAIL (email) {invalid = "" if (! Email) invalid = "Please enter your email address."; Else {ix (((Email.indexof) ") == - 1) | (email.indexof (") == - 1)) Invalid = "/ n / n email address is not legal, should include '@' and '.'; For example: Biz @ 8gem.com. Please check again. "; If (email.indexof (" // ")> - 1) Invalid =" / n / n email address is not legal, containing illegal characters (//). " ; If ("/")> - 1) Invalid = "/ n / n email address is illegal, containing illegal characters (/)."; If (email.indexof ("'")> - 1 ) Invalid = "/ N / N email address is not legal, containing illegal characters (')."; If (email.indexof ("!")> - 1) invalid = "/ n / n email address is not legal, Contains illegal characters (!). "; IF ((Email.indexof (", ")> - 1) || (Email.indexof (")> - 1)) Invalid = "/ n / N Enter one Email address, don't contain a semicolon and comma. "; If (Email.indexof ("? Subject ")> - 1) Invalid =" / n / n Please do not join '? Subject = ...' ";} / / else if (invalid == ") {return true;} // if else {alert (" The input email address may contain the following error: " invalid); return false;} // else} // C HK_EMAIL (Email)