O'Reilly logo

Moodle JavaScript Cookbook by Alastair Hole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using IO's alternative transport method for requesting external URIs

In this recipe, we will look at a method for retrieving data from an external domain. Due to security restrictions, it is not possible to make requests to an external URI with JavaScript's XMLHttpRequest. YUI avoids this restriction by including a built-in alternative transport mechanism based on Adobe Flash. In this way, any trusted domain with a valid cross-domain policy file may be used as a source of data.

Getting ready

First, we need to ensure that the remote domain is configured to accept incoming client requests. This is done by installing a cross-domain policy file crossdomain.xml on the remote domain. This cross-domain policy file specifies which domains are authorized ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required