HTML代码:
{$vo.name}
JQuery代码:
function edit(msg,id){
var text = $(msg).text();
$(msg).html("
$("input[name=‘album‘]").focus();
$("input[name=‘album‘]").blur(function(){
var name = $(this).val();
if(name.indexOf(" ") >= 0 || name == ""){
alert("相册名称不能为空且不能含有空格!");
$("input[name=‘album‘]").focus();//获取焦点
$("input[name=‘album‘]").select();//input内容选中
}else{
if(text == name){
$(msg).html(text);
}else{
$.get( url+"edit?id="+id+"&name="+encodeURI(name), function(result){
if(result != ‘‘){alert(result);}
$(msg).html(name);
});
}
}
});
}
原文:http://www.cnblogs.com/rnckty/p/4094235.html