Permalink
Browse files

README

  • Loading branch information...
1 parent 8cd8499 commit 049ef85e6f31273d3a995aee7a86f4a0d8afb710 @colorhook committed Oct 11, 2010
View
@@ -0,0 +1,13 @@
+<h4>1. Server Proxy</h4>
+Server Proxy�ķ�ʽ��ʹ�÷������������ר���ÿ�����û�п���
+<h4>3. JSONP</h4>
+JSONP (JSON with padding)
+<h4>4. Flash URLLoader</h4>
+<h4>2. Access Control</h4>
+<h4>5. window.name</h4>
+
+<h4>6. window.domain</h4>
+<h4>7. window.postMessage</h4>
+<h4>8. FIM - Fragment Identiter Message</h4>
+<h4>9. Flash LocalConnection</h4>
+<h4>10. Cross Frame</h4>
@@ -1,43 +1,43 @@
-<!doctype html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>crossdomain | Access-Control-Allow-Origin</title>
- <meta http-equiv="X-UA-Compatible" content="IE=Edge">
- <style>
- body, button{
- font-family: Verdana, Arial;
- color: #333;
- }
- h1{
- text-align:center;
- font-size:24px;
- }
- </style>
-</head>
-<body>
- <h1>crossdomain using Access-Control-Allow-Origin</h1>
- <button id='get_resource'>Click to get resource</button>
- <p id='resource_holder'></p>
- <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
- <script>
- $('#get_resource').click(function(){
- var $holder =$('#resource_holder'),
- url = 'http://www.b.com/crossdomain/access-control/resouce.php';
- if(window.XDomainRequest){
- var xdr = new XDomainRequest();
- xdr.open("get", url);
- xdr.send();
- xdr.onload = function(){
- $holder.html(xdr.responseText);
- }
- }else{
- $.get(url,function(data){
- $holder.html(data);
- }
- );
- }
- });
- </script>
-</body>
-</html>
+<!doctype html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>crossdomain | Access-Control-Allow-Origin</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge">
+ <style>
+ body, button{
+ font-family: Verdana, Arial;
+ color: #333;
+ }
+ h1{
+ text-align:center;
+ font-size:24px;
+ }
+ </style>
+</head>
+<body>
+ <h1>crossdomain using Access-Control-Allow-Origin</h1>
+ <button id='get_resource'>Click to get resource</button>
+ <p id='resource_holder'></p>
+ <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
+ <script>
+ $('#get_resource').click(function(){
+ var $holder =$('#resource_holder'),
+ url = 'http://www.b.com/crossdomain/access-control/resouce.php';
+ if(window.XDomainRequest){
+ var xdr = new XDomainRequest();
+ xdr.open("get", url);
+ xdr.send();
+ xdr.onload = function(){
+ $holder.html(xdr.responseText);
+ }
+ }else{
+ $.get(url,function(data){
+ $holder.html(data);
+ }
+ );
+ }
+ });
+ </script>
+</body>
+</html>
@@ -1,6 +1,6 @@
-<?php
-header("Access-Control-Allow-Origin: http://www.a.com");
-//header("Access-Control-Allow-Method: POST");
-//header("Access-Control-Allow-Headers: X-PINGOTHER");
-echo "That's right! You can make crossdomain asynchronous HTTP request by specify the HTTP response header: Access-Control-Allow-Origin";
+<?php
+header("Access-Control-Allow-Origin: http://www.a.com");
+//header("Access-Control-Allow-Method: POST");
+//header("Access-Control-Allow-Headers: X-PINGOTHER");
+echo "That's right! You can make crossdomain asynchronous HTTP request by specify the HTTP response header: Access-Control-Allow-Origin";
?>
Oops, something went wrong. Retry.

0 comments on commit 049ef85

Please sign in to comment.