var dataForm = {nm: $("#nm").val(), id: id };
$.ajax({
url: baseUrl,
//async : false,
dataType : "json",
type: "POST",
data: dataForm,
success:function(result){
var cnt = result;
if(cnt > 0){
span.text("중복된 값.");
}else{
span.text(" ");
document.form2.submit();
}
},
error:function(e){
}
});




덧글
@RequestMapping(value="url", method=RequestMethod.POST)
@ResponseBody
public int methodName(VO Vo) throws Exception{
int result =service.name(Vo);
return result;
}
baseUrl = getUrl();
function getUrl(){
pathArray = location.href.split( '/' );
protocol = pathArray[0];
host = pathArray[2];
url = protocol + '//' + host+'/'+pathArray[3];
return url;
}