O'Reilly logo

Programming Social Applications by Jonathan LeBlanc

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

Bypassing the Same-Origin Policy Requirements

When running into issues with the same-origin policy, developers implement some of the following methods to bypass these browser restrictions:

  • Using a server-side proxy script. For instance, your JavaScript file can make a request to some PHP or Python script that it has access to, which in turn can facilitate server-to-server communication to some cross-domain source.

  • Implement a Flash transport layer. In the same way that the server-side proxy works, some developers have used Flash to proxy requests to overcome the limits imposed by the same-origin policy.

  • Generating iframes to pass data from a source site through to another location where the iframe is loaded.

There are numerous other ways to bypass the issue of communication between sites due to the same-origin policy restrictions, but these are a few of the most commonly implemented.

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