Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

In order to make XHR requests in an open social gadget, you must first have a fully built url, and then pass that url to a makeRequest or osapi.http api which will fetch the url through a proxy. Script tag injection does not suffer from the same origin limitations as xhr requests do, and thus do not need to make use of a proxy.

Dojo 1.7+ uses this the script injection method of code loading, so it is recommended that gadgets use this version.

Cross domain (xdomain) builds of prior versions of dojo Prior versions(before 1.7) of dojo can be made to load code in the same way. Dojo will need to be built to use the cross domain (xdomain) loader. The xdomain loader is not the normal loader, so existing code would need to be tested against itcould potentially have unexpected issues.

In either case, it should be noted that dojo's xhr module will not work well in a gadget environment and some tweaking is required to get it to work transparently. More info will be added later.An example of piping dojo's xhr requests through the osapi.http api is shown below.

Examples

  1. Simple dojo 1.4.3 gadget
  2. Simple dojo 1.7 gadget
  3. Simple dojo 1.8 gadget
  4. Dojo 1.8 xhr demo