Forums

Posting in these forums is disabled. These forums will be available for archive purposes. Please join the new forums at the links below:

  • yui-support - replaces the `YUI 3.x` and `YUI 3 Gallery` forums.
    We have created the following discussion categories within this group to aid discoverability for these most-used topics:
    • Charts for YUI Charts support.
    • DataTable for YUI DataTable support.
    • Gallery for YUI Gallery support, including support for published Gallery components as well as the Gallery process in general.
    • Tools for support of YUI’s suite of developer tools such as selleck, shifter, grover, yogi, etc.
    • Everything Else for questions that don’t fit one of the categories above, we’ve got you covered here.
  • yui-deprecated - replaces the `YUI 2.x` forum and the forums of other deprecated products (`YUI Doc`, `Builder`, `YUI PHP Loader`, etc.).
  [ 9 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic

fm1981

  • Username: fm1981
  • Joined: Tue May 03, 2011 9:40 am
  • Posts: 10
  • GitHub: fm1981
  • Gists: fm1981
  • IRC: fm1981
  • Offline
  • Profile
Tags:
  • connection
  • get
  • utility
  • cross-domain

Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Mon Jun 13, 2011 7:58 am
+0-
Hello,
I have a question regarding YUI's Get Utility, if someone can answer please.

I am using YUI's Connection Manager to make an ajax call and get an HTML file. The issue with this is Cross-Domain data retrieval. As I was trying to find a solution to this, I found out about YUI's GET utility (http://developer.yahoo.com/yui/get/), which allows cross domain retrievals.

The question I have is that is it only meant for script files and CSS, or can I use it to get HTML files? It is a requirement to get the content from HTML files.

Thanks,
Faisel.

Ryan Grove

YUI Developer

  • Username: rgrove
  • Joined: Tue Dec 09, 2008 9:55 pm
  • Posts: 275
  • Location: Portland, OR
  • Twitter: yaypie
  • GitHub: rgrove
  • Gists: rgrove
  • IRC: rgrove
  • YUI Developer
  • Offline
  • Profile
Tags:
  • css
  • utility

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Mon Jun 13, 2011 9:14 am
+0-
No, Get can only load JavaScript and CSS files. The only way to load cross-domain HTML files would be to use a cross-domain XMLHttpRequest or Flash. Both of these are supported by the IO module in YUI 3, but are not supported in YUI 2.

fm1981

  • Username: fm1981
  • Joined: Tue May 03, 2011 9:40 am
  • Posts: 10
  • GitHub: fm1981
  • Gists: fm1981
  • IRC: fm1981
  • Offline
  • Profile

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Mon Jun 13, 2011 9:54 am
+0-
Thanks for your quick reply Ryan. Saved me some time....I will look into the other options that I have, since I am not sure when we will upgrade to YUI 3.

Thomas S. Sha

YUI Contributor

  • Username: tsha
  • Joined: Thu Jan 08, 2009 10:16 am
  • Posts: 206
  • Offline
  • Profile
Tags:
  • connection
  • examples
  • io
  • utility
  • xml

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Mon Jun 13, 2011 10:03 am
+0-
Did you have a look at this YUI 2 example: http://developer.yahoo.com/yui/examples ... n/xdr.html ?

The flash transport, from YUI 3 IO, was backported to YUI 2. There are specific requirements to make cross-domain requests with this transport, namely the deployment of a crossdomain.xml policy file with the correct permissions (see: http://developer.yahoo.com/yui/connection/#xdr).

Regards,
Thomas

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 676
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile
Tags:
  • utility

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Mon Jun 13, 2011 10:05 am
+0-
Hey Ryan / Faisel,

I haven't used this but doesn't YUI 2 provide some xdr capability via the "connection.swf" Flash connector http://developer.yahoo.com/yui/connection/#xdr ?

Todd

Ryan Grove

YUI Developer

  • Username: rgrove
  • Joined: Tue Dec 09, 2008 9:55 pm
  • Posts: 275
  • Location: Portland, OR
  • Twitter: yaypie
  • GitHub: rgrove
  • Gists: rgrove
  • IRC: rgrove
  • YUI Developer
  • Offline
  • Profile

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Mon Jun 13, 2011 10:07 am
+0-
@Thomas/Todd: Whoops, you're right, YUI 2 does support Flash-based XDR! I didn't even notice that had been backported. Kudos.

fm1981

  • Username: fm1981
  • Joined: Tue May 03, 2011 9:40 am
  • Posts: 10
  • GitHub: fm1981
  • Gists: fm1981
  • IRC: fm1981
  • Offline
  • Profile
Tags:
  • utility
  • yql

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Mon Jun 13, 2011 10:59 am
+0-
Yes, I knew about doing XDR with Flash, but
1.) it creates a dependence on Flash, and if someone does not have Flash (very small % of users), that may be an issue.

2.) The code will be used by multiple applications, possibly across multiple domains, so policy file deployment is another factor.

I was also looking at YQL, but the issue that I will run into here is that the page should be reacheable by YQL.

The option is to use a server proxy.

I am just trying to figure out the best solution.

Thanks everyone

Nick Husher

YUI Contributor

  • Offline
  • Profile

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Tue Jun 14, 2011 5:58 am
+0-
Cross-domain content retrieval is a sticky wicket.YUI is able to easily handle cross-domain JS and CSS is that you can plug a script or link tag into your document with the URL, and the browser will download it for you.

Markup is a different beast entirely: you can include content with an iframe, but it's standboxed. You can use a flash-based XDR request, but that relies on flash and requires policy files to be placed in the right place (as you mention). You can use a cross-domain XHR request, but that's not available across all major browsers.

It's my experience that a local proxy that lets you grab remote content is the most straightforward way of doing things.

Todd Smith

YUI Contributor

  • Username: stlsmiths
  • Joined: Thu Nov 05, 2009 10:03 am
  • Posts: 676
  • GitHub: stlsmiths
  • Gists: stlsmiths
  • IRC: t_smith
  • Offline
  • Profile

Re: Using YUI's Get Utility to get Cross-Domain HTML file!

Post Posted: Tue Jun 14, 2011 6:26 am
+0-
I agree fully Nick. With respect to a local proxy approach, are you referring to (for example) using a PHP script on the server to grab content (using curl or other similar libraries) and then providing it to the client front-end? This would all be same-source and not XDR.
  [ 9 posts ]
New Topic | Post Reply | Print view
Previous topic | Next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum