Can JavaScript load XML data from a third-party domain?

Can JavaScript download RSS feeds from Yahoo ?

Is JS side accessible on the client side for third-party domains?

+5
source share
5 answers

You can use the technique outlined in my blog post Unsigned Yahoo Query Langauge Guide

You will query the XML data table with yql status as follows:

select * from xml
  where url="http://path/to/xml
Then you add the script tag to your html (can be done with document.createElement ('script')) with src http://query.yahooapis.com/v1/public/yql?q= {your yql here} & format = json & callback = {your function here}, where {your yql here} replaces the URI-encoded version of your yql statment.
+2
source

An easy way to do this is to proxy the request through the server on which your page is located. Steps:

  • Writing to the server, the script makes an HTTP request in the rss channel when this script itself is a request (i.e. via get or post)
  • Use ajax to request the server side of the script, or simply call it from the main script for this page.
  • The server side of the script then returns the feed source in some displayed form.
  • Profit!

IE 8 FF 3.1 ( ) , . :

http://dannythorpe.com/2009/01/15/ie8-cross-domain-request-support-demo/ http://ejohn.org/blog/cross-site-xmlhttprequest/ FF 3.0, , 3.1

, , CSS .

+2

API Google Feed RSS JavaScript /. , -, RSS- Google , . , Slashdot.

API- RSS Silverlight .

+2

JS, , API Google RSS-. , , , , , , , .

0

. Dana JSONP, JSON , script, DOM. API ( API Yahoo).

0
source

All Articles