forked from jpillora/xdomain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (35 loc) · 1.55 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML>
<html>
<body>
<a href="https://github.com/jpillora/xdomain">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
<h3>XDomain Demo</h3>
<p>
Cross-domain XHR access to Amazon (http://s3.amazonaws.com)<br>
From '<span id="host"></span>'<br>
</p>
<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>
<h5>Same domain: 'example/files/data1.json'</h5>
<pre id='same'>Loading...</pre>
<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>
<script type="text/javascript">
//show current origin
$("#host").html(xdomain.origin);
//jquery ajax call
$("#same").load('example/files/data1.json');
$("#cross").load('https://s3.amazonaws.com/jpillora-usa/xdomain/data2.json');
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-38709761-8', 'jpillora.com');
ga('send', 'pageview');
</script>
</body>
</html>