Please see easyXDM for updated info!
I’ve just completed the first version of my cross-site scripting library easyXSS. It is available at http://code.google.com/p/easyxss/ under a MIT-license.
As it is now it supports simple messaging between windows of different domains, but it also supports proxying method calls and results between them making it well-suited for creating API’s.
I’ve prepared several examples and demo’s at http://code.google.com/p/easyxss/ and look forward to getting feedback!
To show you a quick example, here is the code needed to have a method ‘doMagic’ that is located on domainA available in a window from domainB.
This is placed in the document api.html at domainA
var channel = easyXSS.createChannel({
onReady: function(){
remote = easyXSS.createInterface(channel, {
local: {
doMagic: _privateMethodDoingMagic
}
});
}
});
and this is placed in the document at domainB
var remote;
var channel = easyXSS.createChannel({
local: "/hash.html",
remote: "http://domaina.com/api.html",
onReady: function(){
remote = easyXSS.createInterface(channel, {
remote: {
doMagic: {}
}
});
}
});
The medhod doMagic can now be called from domainB using
remote.doMagic('argument1',2,'three',function(result){
// Consume the result
});
My name is Øyvind Sean Kinsey and I am currently a software engineer at