ajax

Discuss anything that's related to the Raxan framework

Re: ajax

Postby raymond » Wed Jul 07, 2010 1:49 pm

Hi,

Welcome to the community.

There are a numbe of ways that you can accomplish this.

1. You can use a third party solution like Yahoo pipes. See http://pipes.yahoo.com/pipes/
2. Or you can use PHP on the server-side

Here's a quick example of how you can use Raxan on the server-side to check for RSS feeds on another website:

// Using the latest developer build...
// save as rss.php page
class MyPage extends RaxanWebPage {
protected _load() {
$url = $this->post->urlVal("url"); // sanitize url
if (url) {
$page = new RaxanWebPage("http://".$url);
$rss = $page['link[type~="rss"]'];
$rssurl = $rss->attr('href'); // get the RSS url
// do something with the rss url
// or echo it to client
$this->halt($rssurl);
}
}
}

From the client you can call the above php page:

$.ajax({
url:"rss.php",
type: 'POST',
data: ({url : "www.bbc.com"}),
dataType: "html",
success: function(html) {
alert(html);
}
});
raymond
Site Admin
 
Posts: 215
Joined: Tue Mar 17, 2009 5:04 am

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests

cron