trigger.io: should I use request.ajax or jQuery.ajax

ajax, backbone.js, jquery, trigger.io

Solution

The request module gives a couple of important benefits over plain old XHR:

- you can make cross-domain requests without needing JSONP or CORS

- you can upload files captured with the file module (for example)

The first advantage is really useful if you're interacting with 3rd party APIs that you don't control, or you just don't want to bother doing extra server-side configuration.

The second advantage means you can easily upload pictures and videos from the device's camera or gallery to your website, or some other 3rd party.

Problem

What advantages does `forge.ajax` has over plain old `jQuery.ajax` or `backbone.save()` calls? I understand that the forge api may have support for cross-domain requests, but I can achieve the same thing using jQuery or any other AJAX lib. The basic trigger.io example on github is using its own api: https://github.com/trigger-corp/Forge-Bootstrap/blob/master/js/demo.js If I use jQuery and/or Backbone "regular" ajax calls, will it have any effect on app packaging?

Original source