Currently, I have a function called test_fn
that is being called in two ways:
(a) Through an onclick
event of a button; or (b) from the success
callback within a jQuery AJAX request, as shown here:
$.ajax({
type: 'POST',
...
success: function(data) {
test_fn();
}
});
Interestingly, I've observed that my Firefox browser (3.6.17 on Linux) Error Console does not display any javascript errors that occur within code triggered by the AJAX success function. However, it does show errors normally when triggered by a user action.
For instance, if my test function test_fn
is defined like this:
function test_fn() {
blah
}
An obvious javascript error would be displayed in the Error Console when test_fn
is called through a button click, but not when it is invoked via a successful AJAX call.
I have searched online for information regarding issues with javascript errors not being logged during AJAX calls, but haven't come across anything concrete. Since a significant portion of my javascript functions are executed within AJAX callbacks, I'm concerned that this behavior might be causing some trouble without proper error messages to debug and trace back to.
If anyone has encountered similar situations or can provide guidance on resolving this issue, your help would be greatly appreciated. Thank you.