asp.net webform 增加 loading
<script type="text/javascript"> $(function () { $("form").submit(function () { $.jBox.tip("正在执行,请稍后...", 'loading'); }); $("form").each(function () { this.submitx = this.submit; this.submit = function () { $.jBox.tip("正在执行,请稍后...", 'loading'); this.submitx(); }; }); }); </script>
为了配合客户端验证,最新改进型:
<script type="text/javascript"> window.isPageValid = null; $(function () { $("form").submit(function (e) { if (window.isPageValid != null && !window.isPageValid) { window.isPageValid = null; return false; } window.isPageValid = null; $.jBox.tip("正在执行,请稍后...", 'loading'); return true; }); $("form").each(function () { this.submitx = this.submit; this.submit = function () { if (window.isPageValid != null && !window.isPageValid) { window.isPageValid = null; return false; } window.isPageValid = null; $.jBox.tip("正在执行,请稍后...", 'loading'); this.submitx(); }; }); window.RealPage_ClientValidate = window.Page_ClientValidate; window.Page_ClientValidate = function (validateGroup) { var result = window.RealPage_ClientValidate(validateGroup); window.isPageValid = result; return result; } }); </script>
桂棹兮兰桨,击空明兮溯流光。