(function($){ // 保存原有的jquery ajax; var $_ajax = $.ajax; $.ajax = function(options){ var originalSuccess, mySuccess, success_context; if (options.success) { // save reference to original success callback originalSuccess = options.success; success_context = options.context ? options.context : $; // 自定义callback mySuccess = function(data) { if( data.indexOf("<body name=\"loginPage\"") >= 0){ window.location.href =baseURL+"/login.jsp"; return; }else{ // call original success callback originalSuccess.apply(success_context, arguments); } }; // override success callback with custom implementation options.success = mySuccess; } // call original ajax function with modified arguments $_ajax.apply($, arguments); }; })(jQuery);
Ajax 提交session实效跳转到完整的登陆页面,布布扣,bubuko.com
原文:http://www.cnblogs.com/jennybackup/p/3894214.html