I have a requirement where I need to fire an ajax call(dojo xhrPost)on click of an anchor, but as soon as I click the anchor link browser starts to redirect but ajax call is not finished yet, so I always got bad http return code 0 from the server. I can see in the firebug/developer tool.
Is there any way to stop browser redirect until the ajax call finished or returned a proper response like 200.
here is the code in dojo
Expand|Select|Wrap|Line Numbers
- function submitForm{
- dojo.xhrPost({
- url: some url,
- form : someform,
- load(function(response, ioArgs){
- //some stuff
- }),
- error(function(response, ioArgs){
- //some stuff
- })
- });
- }
pls suggest any solution for this.
thanks,
Rakesh