Plan B: Remote Scripting With IFRAMEs

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: , , , , , , , , , , , , , ,

2 Comments

  1. Posted August 1, 2007 at 3:13 pm | Permalink

    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.

  2. Posted August 30, 2007 at 3:38 am | Permalink

    I am also in a similar predicament - and I don’t know a good solution either…

3 Trackbacks/Pingbacks

  1. [...] [2] Plan B: Remote Scripting With IFRAMEs [...]

  2. 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…

  3. [...] » 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

Your email is never published nor shared. Required fields are marked *
*
*

 

User contributed tags for this post:

cross domain iframe (370) - iframe cross domain (340) - xmlhttprequest cross domain (206) - ajax cross domain (184) - javascript cross domain scripting (168) - iframe domain (151) - xmlhttprequest cross site (119) - iframe cross domain script (112) - cross domain ajax (102) - cross domain scripting iframe (97) - iFrame cross site (88) - cross domain xmlhttprequest (82) - enable cross site scripting (73) - cross domain javascript (69) - iframe cross domain scripting (66) - crossdomain javascript (58) - Cross domain iframes (57) - jquery iframe (56) - cross domain ajax iframe (54) - remote scripting iframe (53) - ajax Iframe (53) - Cross Domain Javascript iframe (52) - firefox cross domain scripting (52) - javascript cross domain (51) - javascript cross domain iframe (49) - ajax cross domain iframe (45) - cross domain iframe scripting (45) - enable cross domain scripting (44) - allow cross site scripting (44) - javascript iframe cross domain (43) - firefox enable cross site scripting (43) - cross domain scripting (40) - javascript iframe (39) - allow cross domain scripting (39) - iframe crossdomain (39) - cross site iframe (39) - javascript crossdomain (35) - iframes cross domain (35) - cross domain iframe javascript (34) - iframe xss (33) - scripting iframes (33) - REMOTE SCRIPTING WITH IFRAME (33) - remote scripting firefox (31) - IFrame remote scripting (31) - cross domain scripting javascript (29) - iframe remote (29) - XMLHTTPRequest crossdomain (28) - remote script iframe (27) - javascript iframe firefox (26) - ajax iframe cross domain (26) - firefox allow cross site scripting (26) - javascript iframe domain (25) - ajax cross site scripting (25) - enable cross site scripting firefox (25) - iframe google maps crossite (24) - iframe cross scripting (24) - iframe ajax cross domain (24) - cross site ajax iframe (24) - ajax cross site (23) - firefox enable cross domain scripting (23) - iframe cross site scripting (23) - cross site scripting xmlhttprequest (23) - XMLHttpRequest bookmarklet (22) - ajax crossdomain (22) - XMLHttpRequest subdomain iframe (22) - cross domain remote scripting (21) - cross site xmlhttprequest (21) - cross domain IFrame ajax (20) - XMLHttpRequest cross site scripting (19) - cross domain scripting firefox (19) - iframe cross domain javascript (18) - xmlhttprequest cross (18) - jquery iframe parent (18) - iframe javascript cross domain (17) - iframe cross domain ajax (17) - remote iframe (17) - xmlhttprequest firefox (16) - cross domain ajax google maps (16) - remote scripting iframes (16) - javascript iframe cross site (16) - crossdomain scripting (16) - google maps cross domain (15) - enable cross domain scripting firefox (15) - javascript iframes firefox (15) - cross site javascript iframe (15) - iframes cross site (15) - cross domain hack (15) - remote scripting cross domain (14) - Firefox remote scripting (14) - javascript iframe scripting (14) - IFRAME cross domain xmlhttprequest (14) - how to allow cross site scripting (14) - iframe javascript (13) - Firefox iframe javascript (13) - how to enable cross site scripting (13) - javascript iframe remote (13) - iframe JavaScript restrictions (13) - iframe sandbox (13) - iframe remote script (12) - scripting iframe (12) - ajax cross (12) - iframes (12) - cross domain ajax mozilla (12) - enable iframes in firefox (12) - cross domain firefox (12) - iframe firefox (12) - javascript iframe Remote Scripting (12) - xss iframe (12) - scripting firefox (11) - iframe javascript domain (11) - firefox iframe cross domain (11) - enable cross domain firefox (11) - firefox enable cross domain (11) - F (11) - allowing cross site scripting (11) - remote scripting (10) - remote scripting iframe javascript (10) - google xmlhttprequest cross domain (10) - crossdomain iframe (10) - ajax same origin (10) - AJAX iframes (10) - cross domain javascript frame (10) - firefox cross site scripting enable (10) - enable cross site scripting in firefox (10) - iframe cross domain security (10) - firefox cross frame scripting (10) - xmlhttprequest different domain (10) - cross site scripting enable (10) - cross site scripting allow (10) - cross iframe scripting (9) - hidden iframe remote scripting (9) - AJAX IFrames cross domain (9) - javascript iframe remote script (9) - firefox cross domain (9) - firefox enable remote scripting (9) - remote scripting hidden iframe (9) - cross site scripting and AJAX (9) - enabling cross site scripting (9) - iframes remote scripting (8) - ajax cross domain mozilla (8) - xmlhttprequest remote domain (8) - firefox cross domain javascript (8) - ajax firefox (8) - enable cross scripting (8) - javascript cross domain post (8) - javascript iframes (8) - iframe same origin (8) - cross site ajax google map (8) - remote scripting demo (8) - javascript iframe post (8) -