I have plans to apply AJAX to our library catalog but I’m running into a problem where I can’t do XMLHttpRequest events to servers other than the one I loaded the main webpage from. Mozilla calls it the “same origin policy,” everyone else calls it a cross-domain script exclusion, or something like that.
Some Mozilla folks are working on a standard to address the problem, but it could be quite a while before browser support is common enough to build for it.
So Plan A was to use simple AJAX with XMLHTTPRequest. Plan B comes from this crazy suggestion at Apple’s developer site: Remote Scripting with IFRAME. It looks like different functions are subject to different restrictions, so the theory is that a JavaSctript loaded in a page in a hidden IFRAME can call functions from the parent page and do pretty much everything we’ve come to expect of XMLHTTPRequest. Here’s an example they offer.
Crazy as it is it works, and it gets around some cross-domain script exclusions for some browsers, but it still gets trapped by Mozilla.
tags: ajax, apple, browser security, browsers, cross domain, cross domain script exclusion, frustration, iframe, javascript, mozilla, remote scripting, web application, web applications, xdomain, xmlhttprequest

2 Comments
Any success in this arena? We’re implementing a proxy for our own work, but wish to offer JavaScript libraries for others to access our utilities.
I am also in a similar predicament - and I don’t know a good solution either…
3 Trackbacks/Pingbacks
[...] [2]Â Plan B: Remote Scripting With IFRAMEs [...]
Single pure javascript to extract information from a webpage at different domain is impossible!…
I tried to load some webpages via an iframe. I can load a arbitrary webpage into an iframe, but I can’t access any information from this iframe for security issues. Cross-domain information exchange seems to be impossible, if I don’t have s…
[...] » Plan B: Remote Scripting With IFRAMEs So Plan A was to use simple AJAX with XMLHTTPRequest. Plan B comes from this crazy suggestion at Apple’s developer site: Remote Scripting with IFRAME. It looks like different functions are subject to different restrictions, so the theory is that a JavaS (tags: maisonbisson.com 2007 cross_domain ajax) [...]
Post a Comment