jpillora / xdomain

A pure JavaScript CORS alternative
https://jpillora.com/xdomain/
3.12k stars 270 forks source link

no access to proxy.html #110

Closed andyscott12 closed 9 years ago

andyscott12 commented 10 years ago

hey,

i am trying to implement xdomain but i don't have access to load the proxy.html onto the slave domain. i have access to the site but only to header and footer tags - so i can definitely implement javascript.

my scenario is like -

1) http://abc.com is loading a script from http://xyz.com which loads data from http://xyz.com 2) abc.com has integrated the script

how can i make abc.com load the XHR data from xyz.com without loading proxy.html ?

jpillora commented 10 years ago

So you can put the slave script on any page on xyz.com and use it as a proxy.html:

<script src="//cdn.rawgit.com/jpillora/xdomain/gh-pages/dist/0.6/xdomain.min.js" master="http://abc.example.com"></script>

The hidden iframe on abc.com will load the xyz.com page, so it'll waste some bandwidth loading unessesary css/js/html though it should still work

st32lthx commented 9 years ago

Hey @jpillora , is it possible to do something like this when working with a RESTful API like Storify's API?