Your Ad Here
Google

Monday, March 12, 2007

 

Video 3 - Debugging ASP.NET AJAX Applications with VS.NET 2005

Labels:


 

Video 2 - Add ASP.NET AJAX Features to an Existing Web Application

Labels:


 

Video 1 - Get Started with AJAX


Labels:


Thursday, March 08, 2007

 

Ajax RSS reader

The first thing I thought about doing when I read about requesting Extensible Markup Language (XML) from JavaScript code on a Web page was to get some RSS and display it. But I immediately ran into the security issue of XML Hypertext Transfer Protocol (HTTP), where a page that comes from www.mysite.com can't address pages from anywhere other than www.mysite.com. My plans to build a generic RSS reader in just the page were dashed. But Web 2.0 is all about ingenuity, and solving the problem of how to create an RSS reader with XMLHTTP teaches a lot about how to program the 2.0 Web.
This article walks through the construction of an Ajax-based RSS reader using both XMLHTTP and



The page has one control on it, the control.
When I browse to this in Firefox, I see the output in Figure 3.Figure 3. The first version of the RSS reader
To get these first few feeds into the system, I use the MySQL interface to add them manually.
The next step is to display the content of the selected feed. Listing 9 shows the upgraded code.Listing 9. index3.html
Ajax RSS Reader






I omitted the processReqChange and loadXMLDoc functions because they are the same as before. The new code is in the loadFeed and parseFeed functions that request data from the read.php page, parse it, and add it to the page.
Figure 4 shows the output of this page in Firefox.Figure 4. The upgraded page that shows the article list
The next step is to finish the page with the ability to add a feed to the list through the add.php page. This final code for the page is in Listing 10.Listing 10. index.html
Ajax RSS Reader







Most of the code here is the same, but I have inserted a new Add Feed... button that opens a dialog box where you can insert a new URL into the feed list. To make it easy on myself, I have the browser wait for two seconds and then get the new feed list after the feed has been added.
Figure 5 shows the finished page.Figure 5. The finished page
Now this is pretty cool. But I'm not satisfied because the XMLHTTP security prevents me from taking the JavaScript code from this page and copying it onto someone else's blog so that anyone can look at the feeds. To do that, I need to re-engineer the services to use the




This page is similar to the original index.html page. However, instead of using the loadXMLDoc function, I use a new function, called loadScript, that creates a
Google
Links
archives

Google
Google



Your Ad Here
Your Ad Here
Your Ad Here
Your Ad Here