chenghong / domassistant

Automatically exported from code.google.com/p/domassistant
1 stars 0 forks source link

Implement Synchronous AJAX calls are not possible #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
At the moment synchronous AJAX calls are only possible if you change the
hardcoded parameter from true to false

XMLHttp.open(method, url, false);

but if you do it, it won't be ready to handle the callback, because the
event onreadystatechange never fires.

I needed a small and reliable AJAX library to use, so I used DOM Assistant
AJAX module, but I introduced 2 changes:

changed open paramteter to false
put a call to callbackFunction right after the send method is invoked

//should only be used if AJAX is asynchronous
doCallback(XMLHttp.responseText)

obviously these are hacks, and it would be great if synchronous calls were
possible with ajax.config

Original issue reported on code.google.com by kow...@gmail.com on 28 Oct 2008 at 1:39

GoogleCodeExporter commented 9 years ago
That is obviously an enhancement, not a defect.

Original comment by kow...@gmail.com on 28 Oct 2008 at 1:40

GoogleCodeExporter commented 9 years ago

Original comment by chengh...@gmail.com on 2 Nov 2008 at 1:13