// 弹出错误信息,并使出错的控件获得焦点function error(element, message) ...{ alert(message); if (typeof element == "string") ...{ element = get(element); } if (element.focus != null) ...{ element.focus(); }}// 对document.getElementById()的包装吧function get(id) ...{ return document.getElementById(id);}// 子窗口关闭的时候,对父窗口进行刷新function reloadOpener(window) ...{ if (window.opener) ...{ if (window.focus) ...{ window.opener.focus(); } window.opener.location.reload(); window.close(); }}