jquery - Debugging Techniques in JavaScript. Async Callbacks -


I am working in an existing backbone / jQuery / coffee script app, it seems that there is a function ( Backbone collection.fet () ) is sometimes called (sometimes the numbers may be different). I think it may be a matter of time because I'm doing a lot of nested callback (AJAX etc.) and having difficulty in debugging it, I could possibly try to change the code to postpone jQuery. But in the mean time, what can I do?

Just tried to roam through the code in Chrome, but it appears that the code is jumping here and there, maybe its different callback processing is being done at the same time?

I'm thinking that I consoles at every event. Will add log + its logic, but should be a better way?

You can add that stack trace to the fetch () function, And see from where it's being called, there are several good stack trace implementations for JS. I have had good success, but there are.

With a stack trace, maybe you can at least see that the most common path is in that function, and it can help reduce the location where to search. It can also clarify the underlying culprit.

Comments