2008/10/22

javascript : jquery ajaxStart and ajaxStop 的用法

ajaxStart和ajaxStop主要是在頁面觸發ajax時,呼叫其他function或程式碼做處理。
要加在$(document).ready(function(){});內
$().ajaxStart(function() {
$.blockUI.defaults.pageMessage = "<table class='loader' summary='Loader Layout' border='0' cellpadding='5' cellspacing='1' width='300px'><tr><td align='left' valign='baseline'><div id='innLoader' style='position: absolute; z-index: 999; border-right: #bbbbbb thin solid; border-top: #bbbbbb thin solid; border-left: #bbbbbb thin solid; border-bottom: #bbbbbb thin solid; width: 300px; background-color: white;'><table><tr><td><img src='/res/layout/v5/ps_loading.gif' width='80' height='80' align='left' style='margin: 3px;' alt='請稍候' /></td><td><p><strong>資料處理中, 請稍候....</strong></p></td></tr></table></div></td></tr></table>";
$.extend($.blockUI.defaults.pageMessageCSS, { margin: '-50px 0 0 -125px', top: '50%', left: '50%', color: '#000', backgroundColor: '#fff', border: '0px solid #aaa' }); $.blockUI();
}).ajaxStop($.unblockUI);

T-SQL 語法風格