
Telamon is a Javascript library which provides cross-domain data access in a way that is similar to how Ajax provides same-domain access. It works around the same-site policy most browsers implement to allow a true distributed data model within Javascript.
Setup
Setting up telamon is easy. There is only one config option in telamon.js:
telamon.pingURL = "";
Set this variable to be the location where you will put ping.js. Now just upload ping.js and telamon.js to your server and include telamon.js in the page or bookmarklet where you want to use it.
Use
Telamon has two main functions: telamon.include and telamon.get.
telamon.include(arr scriptURLs, str callback);
Telamon.include is exactly what it sounds like, a way to include one or more Javascript files. It is functionally the same as adding a <script> tag to your page, but this allows you to do it from Javascript. The first argument is an array of script urls to include, and the second is a string to be eval'd when all the scripts have loaded.
telamon.get(str phpName, arr phpData, str callback);
Telamon.get is also what it sounds like; a way to send a get query. The phpName argument is the URL you want to call. phpData is an associative array of data to include in the call; it will be encoded as ?key=value&key2=value2 in the URL. Callback is again a string to be eval'd.
Your back-end handlers for telamon.include and telamon.get calls should produce regular Javascript. Anything that is output by your handlers will simply be run; there is no responseText to process. However, because telamon does not use the standard XMLHttpRequest object, you need to add one line to the end of each of your returned scripts:
telamon.state = 'ready';
That's it! You can now grab javascripts or JSON objects from any site on the web!
License
Telamon is available under the EPL. However, if you use it I would appreciate it if you'd just let me know where. I'm curious, you know.