我想過濾所有的ajax響應。我發現這個jQuery函數:jQuery.ajaxPrefilter()。 有人能告訴我這是如何工作的? 當用戶沒有登錄時,我必須捕捉到這個PHP響應(fe .:「not_logged_on」),因爲它的時間必須與正常情況下一樣。.ajaxPrefilter()jQuery
例如:
jQuery.ajaxPrefilter(function(response){
if (response == 'not_logged_on')
window.location = "?login";
})
我希望理解我的問題。