Jump to content

Loading RSS feeds with AJAX


davidp

Recommended Posts

I am developing a mapping tool where the user is able to click on a country, and when the user does so, I will dynamically bring up an RSS feed associated with that country. 

 

Well, the problem is simple: AJAX doesn't allow cross-server requests.

 

Solution 1:  I could write a PHP script on my own server.  The PHP script would have to accept a GET or POST variable containing the URL of the RSS feed that I want to load.  I can then use the sockets API to open up a socket in my PHP script, make the request, wait for a response, and then send the response back from my PHP script to the client.  That is a round-about way of doing things, but it will work.

 

The thing is...I don't want to have to do that.  That just doesn't seem like the most elegant way of doing things. 

 

How would any other web page dynamically load RSS feeds contained on any arbitrary server?  Anyone have any ideas?

Link to comment
https://forums.phpfreaks.com/topic/86967-loading-rss-feeds-with-ajax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.