|
Hi guys,
I am trying to load the contents of a cross-domain component from another server, using dojo.io.iframe API; and I am getting the following error: Permission denied to access property 'getElementsByTagName' I did everything as per examples on using dojo.io.iframe, and wrapped the returned data in <textarea>, but I still get this error. Now it looks like cross-domain issue, but isn't working with the cross-domain security restrictions the very point of dojo.io.iframe? You can access the live problem code example at http://www.askonline.net/wp-content/themes/askonline/site-selector3.php Anyway, here is my HTML: <html><body> <script src="http://www.google.com/jsapi"></script> <script>google.load("dojo", "1.7");</script> <script> dojo.config.dojoBlankHtmlUrl = "/blank.html"; dojo.require("dojo.io.iframe"); dojo.ready (function () { dojo.io.iframe.send ({ url: "http://services.askonline.net/ajax/site-selector.mas", content: {callback: "select_site", textwrap: 1}, load: function (data) { alert ("Got:\n\n" + data);}, error: function (e) { alert ("Error: " + e.message);} }); }); </script> </body></html> Here is the response HTML from the site-selector.mas component: <html><body><textarea> <p>Sample response</p> </textarea></body></html> And here is my blank.html: <html><head><script>isLoaded = true;</script></head><body></body></html> The page makes the request, but then is unable to process it. I thought this might have something to do with the CDN-loaded Dojo, but I tried loading it locally, and got the same error. The one thing that seems to be weird is that according to Firebug, blank.html never completes loading, even though I can load it manually by copy-n-pasting the URL into the browser just fine. Am I missing something obvious here? Any help would be much appreciated. Many thanks in advance. ________________________________________________________ Dojotoolkit: http://dojotoolkit.org Reference Guide: http://dojotoolkit.org/reference-guide API Documentation: http://dojotoolkit.org/api Tutorials: http://dojotoolkit.org/documentation [hidden email] http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest |
|
Is your iframe request cross-domain? If it is, the browser cuts
off all access to the document returned by the iframe request, for security purposes. Sincerely, -- Jared Jurkiewicz On Fri, Apr 27, 2012 at 1:55 PM, Victor Danilchenko <[hidden email]> wrote: > Hi guys, > > I am trying to load the contents of a cross-domain component from > another server, using dojo.io.iframe API; and I am getting the following > error: > > Permission denied to access property 'getElementsByTagName' > > I did everything as per examples on using dojo.io.iframe, and wrapped > the returned data in <textarea>, but I still get this error. Now it > looks like cross-domain issue, but isn't working with the cross-domain > security restrictions the very point of dojo.io.iframe? > > You can access the live problem code example at > http://www.askonline.net/wp-content/themes/askonline/site-selector3.php > > Anyway, here is my HTML: > > <html><body> > <script src="http://www.google.com/jsapi"></script> > <script>google.load("dojo", "1.7");</script> > <script> > dojo.config.dojoBlankHtmlUrl = "/blank.html"; > dojo.require("dojo.io.iframe"); > > dojo.ready (function () { > dojo.io.iframe.send ({ > url: "http://services.askonline.net/ajax/site-selector.mas", > content: {callback: "select_site", textwrap: 1}, > load: function (data) { alert ("Got:\n\n" + data);}, > error: function (e) { alert ("Error: " + e.message);} > }); > }); > </script> > </body></html> > > Here is the response HTML from the site-selector.mas component: > > <html><body><textarea> > <p>Sample response</p> > </textarea></body></html> > > And here is my blank.html: > > <html><head><script>isLoaded = true;</script></head><body></body></html> > > The page makes the request, but then is unable to process it. I thought > this might have something to do with the CDN-loaded Dojo, but I tried > loading it locally, and got the same error. The one thing that seems to > be weird is that according to Firebug, blank.html never completes > loading, even though I can load it manually by copy-n-pasting the URL > into the browser just fine. > > Am I missing something obvious here? > > Any help would be much appreciated. Many thanks in advance. > ________________________________________________________ > Dojotoolkit: http://dojotoolkit.org > Reference Guide: http://dojotoolkit.org/reference-guide > API Documentation: http://dojotoolkit.org/api > Tutorials: http://dojotoolkit.org/documentation > > [hidden email] > http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest Dojotoolkit: http://dojotoolkit.org Reference Guide: http://dojotoolkit.org/reference-guide API Documentation: http://dojotoolkit.org/api Tutorials: http://dojotoolkit.org/documentation [hidden email] http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest |
|
And dojo.io.script is the main way to get around cross-domain
restrictions. iframes still have them. If the source of an iframe is a different domain from the rest of the page, the browser cuts off access to the document. Sincerely, -- Jared Jurkiewicz On Mon, Apr 30, 2012 at 11:08 AM, Jared Jurkiewicz <[hidden email]> wrote: > Is your iframe request cross-domain? If it is, the browser cuts > off all access to the document returned by the iframe request, for > security purposes. > > Sincerely, > -- Jared Jurkiewicz > > On Fri, Apr 27, 2012 at 1:55 PM, Victor Danilchenko > <[hidden email]> wrote: >> Hi guys, >> >> I am trying to load the contents of a cross-domain component from >> another server, using dojo.io.iframe API; and I am getting the following >> error: >> >> Permission denied to access property 'getElementsByTagName' >> >> I did everything as per examples on using dojo.io.iframe, and wrapped >> the returned data in <textarea>, but I still get this error. Now it >> looks like cross-domain issue, but isn't working with the cross-domain >> security restrictions the very point of dojo.io.iframe? >> >> You can access the live problem code example at >> http://www.askonline.net/wp-content/themes/askonline/site-selector3.php >> >> Anyway, here is my HTML: >> >> <html><body> >> <script src="http://www.google.com/jsapi"></script> >> <script>google.load("dojo", "1.7");</script> >> <script> >> dojo.config.dojoBlankHtmlUrl = "/blank.html"; >> dojo.require("dojo.io.iframe"); >> >> dojo.ready (function () { >> dojo.io.iframe.send ({ >> url: "http://services.askonline.net/ajax/site-selector.mas", >> content: {callback: "select_site", textwrap: 1}, >> load: function (data) { alert ("Got:\n\n" + data);}, >> error: function (e) { alert ("Error: " + e.message);} >> }); >> }); >> </script> >> </body></html> >> >> Here is the response HTML from the site-selector.mas component: >> >> <html><body><textarea> >> <p>Sample response</p> >> </textarea></body></html> >> >> And here is my blank.html: >> >> <html><head><script>isLoaded = true;</script></head><body></body></html> >> >> The page makes the request, but then is unable to process it. I thought >> this might have something to do with the CDN-loaded Dojo, but I tried >> loading it locally, and got the same error. The one thing that seems to >> be weird is that according to Firebug, blank.html never completes >> loading, even though I can load it manually by copy-n-pasting the URL >> into the browser just fine. >> >> Am I missing something obvious here? >> >> Any help would be much appreciated. Many thanks in advance. >> ________________________________________________________ >> Dojotoolkit: http://dojotoolkit.org >> Reference Guide: http://dojotoolkit.org/reference-guide >> API Documentation: http://dojotoolkit.org/api >> Tutorials: http://dojotoolkit.org/documentation >> >> [hidden email] >> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest Dojotoolkit: http://dojotoolkit.org Reference Guide: http://dojotoolkit.org/reference-guide API Documentation: http://dojotoolkit.org/api Tutorials: http://dojotoolkit.org/documentation [hidden email] http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest |
|
And the main point of dojo.io.iframe was to have a way to upload files
(xhr cannot access the file system to pull files denoted by input fields, but iframes can using native form submit). Sincerely, -- Jared Jurkiewicz On Mon, Apr 30, 2012 at 11:10 AM, Jared Jurkiewicz <[hidden email]> wrote: > And dojo.io.script is the main way to get around cross-domain > restrictions. iframes still have them. If the source of an iframe is > a different domain from the rest of the page, the browser cuts off > access to the document. > > Sincerely, > -- Jared Jurkiewicz > > On Mon, Apr 30, 2012 at 11:08 AM, Jared Jurkiewicz > <[hidden email]> wrote: >> Is your iframe request cross-domain? If it is, the browser cuts >> off all access to the document returned by the iframe request, for >> security purposes. >> >> Sincerely, >> -- Jared Jurkiewicz >> >> On Fri, Apr 27, 2012 at 1:55 PM, Victor Danilchenko >> <[hidden email]> wrote: >>> Hi guys, >>> >>> I am trying to load the contents of a cross-domain component from >>> another server, using dojo.io.iframe API; and I am getting the following >>> error: >>> >>> Permission denied to access property 'getElementsByTagName' >>> >>> I did everything as per examples on using dojo.io.iframe, and wrapped >>> the returned data in <textarea>, but I still get this error. Now it >>> looks like cross-domain issue, but isn't working with the cross-domain >>> security restrictions the very point of dojo.io.iframe? >>> >>> You can access the live problem code example at >>> http://www.askonline.net/wp-content/themes/askonline/site-selector3.php >>> >>> Anyway, here is my HTML: >>> >>> <html><body> >>> <script src="http://www.google.com/jsapi"></script> >>> <script>google.load("dojo", "1.7");</script> >>> <script> >>> dojo.config.dojoBlankHtmlUrl = "/blank.html"; >>> dojo.require("dojo.io.iframe"); >>> >>> dojo.ready (function () { >>> dojo.io.iframe.send ({ >>> url: "http://services.askonline.net/ajax/site-selector.mas", >>> content: {callback: "select_site", textwrap: 1}, >>> load: function (data) { alert ("Got:\n\n" + data);}, >>> error: function (e) { alert ("Error: " + e.message);} >>> }); >>> }); >>> </script> >>> </body></html> >>> >>> Here is the response HTML from the site-selector.mas component: >>> >>> <html><body><textarea> >>> <p>Sample response</p> >>> </textarea></body></html> >>> >>> And here is my blank.html: >>> >>> <html><head><script>isLoaded = true;</script></head><body></body></html> >>> >>> The page makes the request, but then is unable to process it. I thought >>> this might have something to do with the CDN-loaded Dojo, but I tried >>> loading it locally, and got the same error. The one thing that seems to >>> be weird is that according to Firebug, blank.html never completes >>> loading, even though I can load it manually by copy-n-pasting the URL >>> into the browser just fine. >>> >>> Am I missing something obvious here? >>> >>> Any help would be much appreciated. Many thanks in advance. >>> ________________________________________________________ >>> Dojotoolkit: http://dojotoolkit.org >>> Reference Guide: http://dojotoolkit.org/reference-guide >>> API Documentation: http://dojotoolkit.org/api >>> Tutorials: http://dojotoolkit.org/documentation >>> >>> [hidden email] >>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest Dojotoolkit: http://dojotoolkit.org Reference Guide: http://dojotoolkit.org/reference-guide API Documentation: http://dojotoolkit.org/api Tutorials: http://dojotoolkit.org/documentation [hidden email] http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest |
| Powered by Nabble | Edit this page |
