function checkName() {
var name_hint = $("#name_hint");
var roleNameVal = $("#nodeName").val();
roleNameVal=encodeURI(roleNameVal);
name_hint.html("");
if (roleNameVal == "") {
name_hint.html("<font color=red>导航名称不能为空,请输入</font>");
return false;
} else {
url = "<%=basePath%>menu/addMenu!checkName.action?nodeName="+roleNameVal;
url += "&a=" + Math.floor(Math.random() * 1000);
$.post(url, null, nameRequest);
}
}
function nameRequest(data) {
var name_hint = $("#name_hint");
if (/t/.test(data)) {
name_hint.html("<font color=red>此名称已存在,请重新输入</font>");
checkNameFlag = false;
return;
} else {
name_hint.html("<font color=red></font>");
checkNameFlag = true;
}
}