I believe a synchronized get and post option to appAPI.request.get would be lovely.
I'm currently in the situation where I need to receive some data from an url (Same-origin) and use that data, synchronized.
I know the effects of synchronized (Browser-lockup, etc), but as with many other things wrong development can have consequences.
Sort of like:
appAPI.request.get({url:'someurl',async:false, onSuccess: function(data){
//Do stuff
}});
Currently using jQuery with the async flag, but with this I'm not getting the power CORS requests from Crossrider :(
Would you consider adding synchronized requests in get and post?
Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
-
Hello CyberDude,
First of all, thanks for your suggestion.
We did use to have SYNC requests for both POST and GET supported by our cross-browser API.
Unfortunately, we had to deprecate the SYNC API as it used to hang users computers until getting the response back from the server and thus giving poor performance for the extension.
Though async requests are a bit less "fluent" to write you code with, it is still a better practice to use them in your code. -
-
Thanks for your quick response.
That's unfortunate to hear. :(
I'm trying to avoid async callbacks as I'm essentially providing an API that caches the values, but occasionally have to update the data using a get request. Having to write everything in callback notation is a pain, mostly because sometimes the code has to rely on several (2-3) data collections. So the callback code has to handle this manually all the time.
I might have to look into jQuery's Deferred async chaining, or it's async queue :) -
Loading Profile...




EMPLOYEE
