62,041
社区成员
发帖
与我相关
我的任务
分享
function yzname(bhstr) {
if (bhstr != "") {
yzbh001.style.display = "";
yzbh001.innerHTML = "<font color=#FF0000>正在验证用户名,请稍候..</font>";
DB1.regyzuser(bhstr, get_name);
} else {
yzbh001.style.display = "none";
yzbh001.innerHTML = "";
}
}
function get_name(response) {
if (response.value != null) {
var msg = response.value;
if (msg != null && msg != "") {
yzbh001.innerHTML = "<font color=#FF0000>" + msg + "</font>";
} else {
yzbh001.innerHTML = "<font color=#FF0000>此用户名未存在,可以注册。</font>";
}
}
return
}
[AjaxPro.AjaxMethod]
public string regyzuser(string provinceid)
{
string a = "字符";
int stri = 0;
for (int i = 0; i < a.Length; i++)
{
if (("0" + provinceid).IndexOf(a.Substring(i, 1)) > 0)
{
stri = 2;
break;
}
}
if (stri < 2)
{
if ((provinceid.ToString().LastIndexOf("'") < 17) && (provinceid.Replace("'", "").Length > 3))
{
string sql = "select * from shop_table where account_name='" + provinceid.Replace("'", "") + "'";
if (webdata.datatable(sql).Rows.Count > 0)
{
return "<font color=#ff0000>用户已存在不能注册!</font>";
}
else
{
return "恭喜您,此用户名可以注册!";
}
}
else
{
return "必须为4-16个字符!";
}
}
else
{
return "对不起此用户名含有特殊字符不能注册!";
}
}
function xxoo(a,b,c)
{
return b;
}
var rs=xxoo("12345");
如果是这样rs就是undefied了..其实就跟c#函数默认值一样....
public string xxoo(string a ,int b=0);
xxoo("123");
function xxoo(a,b,c)
{
return a;
}
var rs=xxoo("12345");
正常操作返回12345....