Skip to content

Commit

Permalink
docs and fixed index
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora committed Apr 28, 2015
1 parent 60385b9 commit c034d8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -37,10 +37,10 @@ will work seamlessly with any library.
* Production [xdomain.min.js](https://jpillora.com/xdomain/dist/xdomain.min.js) 12KB (5.16KB Gzip)
* CDN

* Latest version is `0.7.1`, though you can change to any [release tag](https://github.com/jpillora/xdomain/releases)
* Latest version is `0.7.2`, though you can change to any [release tag](https://github.com/jpillora/xdomain/releases)

``` html
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.1/dist/xdomain.min.js"></script>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.2/dist/xdomain.min.js"></script>
```

## Live Demos
Expand All @@ -67,13 +67,13 @@ All except IE6/7 as they don't have `postMessage`

``` html
<!DOCTYPE HTML>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.1/dist/xdomain.min.js" master="http://abc.example.com"></script>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.2/dist/xdomain.min.js" master="http://abc.example.com"></script>
```

2. Then, on your master domain (`http://abc.example.com`), point to your new `proxy.html`:

``` html
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.1/dist/xdomain.min.js" slave="http://xyz.example.com/proxy.html"></script>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.2/dist/xdomain.min.js" slave="http://xyz.example.com/proxy.html"></script>
```

3. **And that's it!** Now, on your master domain, any XHR to `http://xyz.example.com` will automagically work:
Expand Down Expand Up @@ -101,11 +101,11 @@ All except IE6/7 as they don't have `postMessage`
The following two snippets are equivalent:

``` html
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.1/dist/xdomain.min.js" master="http://abc.example.com/api/*"></script>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.2/dist/xdomain.min.js" master="http://abc.example.com/api/*"></script>
```

``` html
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.1/dist/xdomain.min.js"></script>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.2/dist/xdomain.min.js"></script>
<script>
xdomain.masters({
'http://abc.example.com': '/api/*'
Expand All @@ -127,7 +127,7 @@ All except IE6/7 as they don't have `postMessage`

The **Quick Usage** step 2 above is equivalent to:
```html
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.1/dist/xdomain.min.js"></script>
<script src="//cdn.rawgit.com/jpillora/xdomain/0.7.2/dist/xdomain.min.js"></script>
<script>
xdomain.slaves({
"http://xyz.example.com": "/proxy.html"
Expand Down Expand Up @@ -313,4 +313,4 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[![Analytics](https://ga-beacon.appspot.com/UA-38709761-8/xdomain/readme)](https://github.com/igrigorik/ga-beacon)
[![Analytics](https://ga-beacon.appspot.com/UA-3870.7.2-8/xdomain/readme)](https://github.com/igrigorik/ga-beacon)
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -11,7 +11,7 @@ <h3>XDomain Demo</h3>
From '<span id="host"></span>'<br>
</p>

<script src="../../dist/xdomain.js"
<script src="dist/xdomain.js"
slave="https://s3.amazonaws.com/jpillora-usa/xdomain/proxy.html"></script>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
Expand All @@ -20,7 +20,7 @@ <h3>XDomain Demo</h3>
<h5>Same domain: 'example/files/data1.json'</h5>
<pre id='same'>Loading...</pre>

<h5>Cross domain 'http://s3.amazonaws.com/jpillora-usa/data2.json'</h5>
<h5>Cross domain 'https://s3.amazonaws.com/jpillora-usa/data2.json'</h5>
<p><i>XHRs will be intercepted and silently sent over to a hidden iframe</i></p>
<pre id='cross'>Loading...</pre>

Expand Down

0 comments on commit c034d8b

Please sign in to comment.