Git Product home page Git Product logo

crossdomain's Introduction

How to share resources crossing domain

These code snippet are a case collection for sharing resources between different domains.

Server Proxy

Server Proxy is using web server to request data from other domain(s) and than provide to self domain,
JavaScript needn’t create a cross-domain HTTP request but just retrieve data from local host.

JSONP

JSONP (JSON with padding) is a easy method, using JavaScript annotation, to share data cross domain.
JavaScript can be load from another domain but has no restriction to execution.

Flash URLLoader

Flash has another security policy, it’s can load data from another domain by setting the policy flie crossdomain.xml.

Access Control

After setting specific HTTP response headers, the resource can to shared to other domains.

window.domain

domain and sub-domain can conmunicate each other after setting their window’s domain property to the same.

window.name

In a window frame, we can assign value to the name property and then change the location URL to the same domain
as parent window frame, then the parent can read the name property. this is a efficient method to share data cross domain.

window.postMessage

window.postMessage is a newer method, which has less browsers support at present, to share data between domains.

FIM – Fragment Identiter Message

the containing page sets the URL fragment identifier of an embedded IFrame, and the IFrame must poll to detect changes
in the value of its location.hash property. this technique allow two-way comunications.

Flash LocalConnection

We can using Flash LocalConnection API to communicate crossing domain, this API allow different SWF call each other, the SWF
can be embeded in HTML page, or play in a standlone player.

Cross Frame

Cross Frame is a variant of the URL fragment identifier mechanism, which add a blank iframe as a proxy, no extra history records occur
and needn’t polling the location hash chang. It however cannot work on Opera, so we need using an other way for Opera browser.
see http://www.julienlecomte.net/blog/2007/11/31/

YQL

YQL (Yahoo! Query Language) is an expressive SQL-like language that lets you query, filter, and join data across Web services.
Yahoo! and other websites across the Internet make much of their structured data available to developers, primarily through Web services. To access and query these services, developers traditionally endure the pain of locating the right URLs and documentation to access and query each Web service.
With YQL, developers can access and shape data across the Internet through one simple language, eliminating the need to learn how to call different APIs.
see http://developer.yahoo.com/yql/
YQL console http://developer.yahoo.com/yql/console/

crossdomain's People

Contributors

colorhook avatar

Watchers

James Cloos avatar simon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.