Skip to content
ryansullPublic

About

Cross Origin AJAX Javascript Library

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

/*******************************************************************************
*   Welcome to Ryan's Tiny Cross Origin AJAX library v1.1
*
*   This library requires jQuery to be loaded.
*
*   This library was written to get around Javascript's Same Origin Policy. The 
*	same origin policy prevents a document or script loaded from one origin from 
*	getting or setting properties of a document from another origin.  This is 
*	great for security reasons, but annoying if you own both origins.  For 
*	example, http://a.geneca.com and http://b.geneca.com cannot communicate with 
*	eachother through ajax calls.  
*
*   XOA uses HTML5 cross document messaging to communicate between 2 different 
*	origins through a dynamically loaded iframe.  
*
*   Example Usage:
*   This example will send a message to a web service.  the webservice will tack 
*	on 'touched by xoa' to whatever message is sent to it, and returns it.
*
*
*   Domain A (web service):
*
*   $(function(){
*       xoa.RegisterWebServiceListener(messageReceivedFromClient);
*   });
*
*	function messageReceivedFromClient(data){
*       xoa.ReturnDataToClient(data + " touched by xoa");
*   }
*
*
*
*   Domain B (client):
*
*   function getStuff(){
*       xoa.PostMessageToWebService('http:\\a.geneca.com\getStuff.htm', 
*			"get stuff", getStuffCallback);
*   }
*
*   function getStuffCallback(data){
*       alert(data);
*   }
*
*
*
*   The result should be that Domain B will alert "get stuff touched by xoa".
*
*   
********************************************************************************/

About

Cross Origin AJAX Javascript Library

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages