Thanks to Sven Hasselbach who inadvertently gave me the information I needed to intercept the ajax call in dojo.
Using
// --- hijack dojo XHR calls dojo._xhr = dojo.xhr; var loadOld; function hijacked( response, ioArgs ){ alert( response ); // change code here to do whatever you want. // loadOld( response, ioArgs ); // call the original function } dojo.xhr = function( mode, args, bool ){ loadOld = args["load"]; args["load"] = hijacked; dojo._xhr( mode, args, bool ); }
I was able to intercept the ajax call being made to the server. As I previously discussed in the original article I knew that the response was blank but was unable to get a handle on it – now I have.
There is also a NotesIn9 video supporting this article
Check out the demonstration (Thanks to David Leedy for hosting)
http://watchtower.notesin9.com/xomino/xPlay.nsf/xTypeAhead.xsp

Here is a XSnippet which listend to TypeAhead-Xhr-Calls only:
http://openntf.org/XSnippets.nsf/snippet.xsp?id=typeahead-onstartoncomplete-event
… and thanks for sharing!
I have posted this XSnippet above just to give you the information about how you can identify if an ajax call is made for a type ahead search (because then there is a special “$$ajaxmode” used). Because if you catch all xhr Calls you will receive the partialRefreshs too.
Sven – thanks very much mate! I have to do a combination with your other code so that I can get the response – working on it and will update the demo once complete. Collaboration works!!
thank you 🙂
I have updates my code and updated the demo – thanks again Sven !!
http://watchtower.notesin9.com/xomino/xPlay.nsf/xTypeAhead.xsp
Thanks for sharing!
🙂