精简代码;
<form name='form0001' method="post"> 。。。。
<li id="view"><a href="#" onclick="formSubmit('toview.action','_self');this.blur();">查看</a></li> <li id="new"><a href="#" onclick="formSubmit('tocreate.action','_self');this.blur();">新增</a></li>
<li id="delete"><a href="#" onclick="formSubmit('delete.action','_self');this.blur();">删除N</a></li>
</form>
/* 打开一个新页面 */
function formSubmit (url,sTarget){
document.forms['form0001'].target = sTarget
document.forms[0].action = url;
document.forms[0].submit();
return true;
}
//删除多条
@RequestMapping("/delete.action")
public String delete(@RequestParam("id") String[] ids) {
System.out.println(ids);
// fyService.delete(ids);
return "redirect:/list.action";
}
this.blur():链接聚焦触发时失去焦点,去除链接获取焦点后外围的虚线框