- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
The Bonehead File - NewsIsFree Newsmap
A friend of mine pointed me at this "nifty Ajax news map" from Newsisfree. These guys have been doing stuff with RSS for a long time. If you needed an RSS feed for a publication that was so behind the times that it didn't have one, Newsisfree gave it to you. At a first glance, it looked pretty slick, with sliders, drop downs, pop-up windows and the ability to change both the language and category you're looking at, all without reloading the page.
So I settled in to investigate. Half the fun in reviewing all of these Ajax applications is in figuring out how they work. My tool of choice for this is the Firefox extension Firebug, the "view source" of the Ajax age. (Face it, these days if you do a literal "view source," you'll have no idea of what's going on.) After loading up the news map, I popped up the debugger and took a quick glance at what JavaScript files were included. At first glance it looked promising: there were prototype.js and moo.fx.js. I prepared myself mentally for some heavy Ajax lifting.
Next some bad news. I noticed a message in the status bar that said "Applet HoneycombLoader started." What a downer, I thought, but then again people are combining Ajax and flash so why not Ajax and applet's? A few more moments of investigation revealed the awful truth: the only Ajax on this page was triggered by the two select boxes at the top -- one for category the other for language. The actual Ajax bit was a request to a PHP script that returned a JSON object that contained a URL. This URL was then used to change the content of the IFrame that held the applet. That's it. Here's the callback that does the business:
function getMapProcess(Request)
{
lightWin.hide();
try { var res = eval('('+Request.responseText+')') }
catch(e) { return hpe.error(e) }
if (res.response_code>=300) {
alert("Failed to generate map");
} else {
var f = $('mapcontainer');
f.src = res.htmlfile;
}
}
This static information could have simply been hardcoded in a JavaScript lookup table and used to change the contents of that IFrame. All that the XHR did was move that static lookup table to a PHP script on the server. All those slider and popups were part of the applet.
I hope this little bit of superfluous Ajax wasn't used to sell the product. Maybe I shouldn't be so bothered about it, but I was so looking forward to analyzing its workings. It's still and interesting app, though; it just doesn't really have anything to do with Ajax.
Topics: Ajax Applications, Ajax Examples
Leave a comment
About Pathfinder
Recent
- Walk-Through Test Coverage
- Where minimalism fails: The problem with Apple’s less-is-more approach
- jQuery goodness with ASP .NET
- Design Thinking
- Bullseye Diagram
- Roles Testing For Security
- Blackbird takes the pain out of JavaScript logging
- Making GWT JSON not Quite so Painful
- IDEA - preconference workshop 06 Oct 08
- HTML5, Ajax history management, and The Ajax Experience 2008 Boston
Archives
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006


