This post below pretty much says it all. The only issue is the solution (I'm looking at Randy's solution in the comments section) is ASP.Net specific and I'm testing a ColdFusion website using WatiN. So I need a solution that will work with ColdFusion…
http://pushpontech.blogspot.com/2008/04/ajax-issues-with-watin.html
I know I could use Thread.Sleep() and pause for a set amount of time but I would really like to have a solution that will wait for the AJAX postback to complete and continue running immediately afterwards.
Ideally, I would like to find a javascript call that I can use to replace of the ASP.Net specific “Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()” call.
Any thoughts?
Update:
@CF Jedi Master Thanks for your reply. Allow me to clarify. Basically, I know that when I perform a specific action, it invokes an AJAX request. I would like to know if there is any JavaScript I could run (on the client side) to tell me that the AJAX request has completed. Could I use JavaScript to query for the current HTTP-Request and check that it matches XMLHttpRequest? If so, you're solution may work for me.
@Peter Boughton "If you want to hijack/monitor HTTP requests on the client, you will need proxy software that the connection has been explicitly configured to use...You cannot do this with JavaScript in a web browser."
Yes, that's exactly it. I want to monitor the AJAX request from the client to see when it has completed. I guess it makes since that you cannot do this in JavaScript since the ASP.Net solution also requires a call back to the web server to see if the request is has completed.
So I guess the question becomes: Does ColdFusion support a method or proxy (like the ASP.Net get_isInAsyncPostBack() method) that I can use to monitor the status of an AJAX request? or will this require the CF developers to create a custom 'hook' in the system that will to return the AsyncPostBack state?
@Peter Boughton: Thanks again for your input. I'd like to give you the accepted answer but as you point out: If you definitely want a CF-based (i.e. extJS) method, you'll have to wait for an equivalent answer from someone that uses that.