search the site  

Enter search terms:


subscribe to newsletters   WebReference.com logo   WebReference.com
dev the Web
tip archive  •   about  •   contact  •   jobs  •   sitemap

Voip -Voice over IP


[next]

How to Create Remote Ajax Requests

By Kris Hadlock

Digg This Add to del.icio.us

ASP 3.0/.NET Developer
Jupitermedia
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Ajax has certainly made itself known over the last year. Even large companies such as Google and Yahoo! have used Ajax in their Web applications and both have even created their own libraries, the Google Web Toolkit (GWT) and the Yahoo! UI Library (YUI). There are even conferences and events, such as AjaxWorld dedicated to the topic and the possiblities are steadily growing. With the increased presence has come new forms of interaction and questions about limitations. One of the most common questions is whether it's possible to create remote or cross-domain Ajax requests. The answer is yes and this week you'll learn how to create an Ajax-enabled podcast aggregator with PHP and Ajax.

Remote Ajax requests allow you to request remote files, such as Web services, RSS feeds and as you'll see in this article, podcasts. The sample that we'll create is a podcast aggregator that relies on Ajax and PHP to retrieve its feeds. It also leverages Odeo to play the podcast files that are referenced in the feed. The sample for this article can be downloaded here and a live running sample can be viewed here. To get you started you can use the "Talk of the Nation" podcast from NPR by pasting http://www.npr.org/rss/podcast.php?id=5 into the input field or you can find more podcasts in the NPR podcast directory.

Designing the Aggregator

In order to begin designing the aggregator we need an index page. In the head of this file we will include three JavaScript files and a stylesheet, which we'll create. This file will consist of a header, left and right column. The header will be wrapped in a form tag that has a JavaScript action, which makes an Ajax request. The header div also includes a feed input and submit button. The leftColumn will include a titles div that will hold all of the titles from a requested feed and the rightColumn will include a description div that will display the contents of a selected item in the feed.

Creating an Ajax Engine

Once we have the design in place we can create the JavaScript files that we are including. The first file is an Ajax engine that will handle all of our requests. It takes a request method, such as GET or POST, a URL to make the request to and a callback method to send the final XML response back to for parsing.


[next]

Recent Articles

WebReference.com site name
Perl Pragma Primer
Implement Drag and Drop in Your Web Apps: Part 2
How to Create an Ajax Autocomplete Text Field: Part 5
internet.com site name
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE)
Vyatta: Downgrades that Pay Off
NetMotion Brings Cross-Network Support to Wireless VoIP

Access FREE HP High-Availability Solutions for Exchange 2007 Tools:
Whitepaper:
Backup and Recovery Best Practices for Microsoft Exchange Server 2007 with HP
Whitepaper:
Best Practices for HP Servers and HP Enterprise Virtual Array in a Microsoft Exchange
Whitepaper:
Optimizing HP Servers with Microsoft SQL Server 2008



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES