Message from JavaScript discussions

May 2017

— ajax("/formInterface", "json", myFormData).then(callback).catch(callback);


And if you need to run code every time it completes, regardless of success or error:

ajax("/formInterface", "json", myFormData).then(callback).catch(callback).then(callback);

— Ok.

— I don't quite understand all this, but I'm going to look through it and see if I can make sense of it.

Message permanent page

— Thanks!

— No problem :D feel free to post a snippet of code if you get stuck

— Haha ok, will do :)

— Fetch API solves this :P

— Solves what?

— Oh you mean the promise

— Until it's standard I will use my snippet :P

— Fetch has polyfills :P