View Full Version : Ajax request never completes

11 Oct 2009, 7:15 AM
For some unknown reason, I am now running into a situation where an Ajax request shows continuous loading in FireBug. The icon is spinning and the "response" tab has a "Load Response" button that when clicked, nothing happens. I was wondering what circumstances would lead to this situation? The web service and passed parameters are in fact correct. The call doesn't even show up in the "Net" tab, making me thinking it's not even getting sent out over the wire. It's almost as if the request is being canceled, but I'm definitely not canceling it anywhere.

11 Oct 2009, 7:45 AM
Here's some additional info. It seems that the store.load is being executed, but store.on.load never fires. so it seems something is happening within the store.load call. There is also no "exception" being fired from either the store or the proxy. They both fire "beforeload", but seems to stop from there. Also, Ajax.on.beforerequest fires, but, requestcomplete or requestexception never fire.

Mike Robinson
12 Oct 2009, 9:35 AM
If, with Firebug, you determine that the request is being sent to the host and the host is sending a response, then you know that there must be "something wrong with" that response ... or with the various parameters that you've set up within ExtJS. The two don't match.

Start with obvious things:

Case sensitivity. Everything in JavaScript is case-sensitive. If the data store is looking for "projectid" and the host supplies "ProjectID" then ... "'projectid' is not there."
Use Firebug to examine the response to make sure that it is exactly in the format that (say...) "JsonReader" says it must have.

It is entirely possible that a lower-level component found a problem, threw an exception, and a higher-level component ate the exception ... without informing you. This creates a very complicated and frustrating bit of "voodoo": when you get it exactly right, it works. But if anything is slightly wrong, the exception gets absorbed and "it just doesn't work and you don't know why."