Created
March 14, 2012 00:02
-
-
Save jdaigle/2032837 to your computer and use it in GitHub Desktop.
Cross-domain requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. load document in domain.com which contains iframe that points to sub.domain.com | |
2. document loaded from sub.domain.com should automatically set document.domain=domain.com | |
- this is required so that the parent frame can access the child frame | |
3. from parent document: new frames[0].XMLHttpRequest() | |
- now you have an XHR document which can open and send to sub.domain.com | |
4. if uses jquery, pass this XHR into $.ajax() via options | |
This should work in every modern web browser, including IE7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment