By douglaskarr
via douglaskarr.com
Published: Nov 24 2006 / 23:24
Many of the Ajax examples out on the web utilize XML. A common and simple method for generating dynamic content from another page can utilize Ajax without XML at all. I know that sounds a bit wacky... the X is for XML, right? Well, I suppose. Do we call this Ajai? Asynchronous JavaScript and InnerHTML?
The method to pass content without XML is one that's commonly utilized throughout the web but not discussed much. I like it because parsing XML is a pain in the butt.
Comments
coboldinosaur replied ago:
nice hack, but it probably has a lot of security issues.
xmldev replied ago:
You obviously no little about XML.
Doug Karr replied ago:
xmldev, thanks for your comment but you couldn't be further from the truth. For the last 3 years I've been working closely with a mountain of APIs and both REST/SOAP based APIs. I'm fluent with DOM in JavaScript, PHP, ASP, and ASP.NET. Having spent some time with the 'big boys' at MashupCamp, I can tell you that working with XML is the most common frustration of most companies. For those of us in the fast lane, it comes easy, but for everyone else it's a big pain in the butt.
kenman replied ago:
What kind of security issues would be introduced that aren't inherently present from traditional AJAX implementations? Perhaps I am overlooking something, but the output format shouldn't have any effect on security (especially since both are unencrypted).
kenman replied ago:
P.S. I'm surprised this article is getting votes, I thought everyone knew how to do this. It's certaintly not ground-breaking, I first used it 3 or 4 years ago, and if anyone took the initiative to check out the javascript API's then they could have discovered that you can substitute "responseText" for "responseXML" at any point in AJAX development.
kenman complained ago:
kenman reported this link as lame on 11/25/2006 @ 04:07:02
old/lame...
ethzero complained ago:
ethzero reported this link as lame on 11/25/2006 @ 05:07:54
weak
ilazarte complained ago:
ilazarte reported this link as lame on 11/25/2006 @ 07:05:32
this type of article just promotes lazy thinking and implementation. developers who are learning would be wise to steer clear of this type of solution since it's inevitably short term.
unchqua replied ago:
This technique is also called "AHAH" (http://en.wikipedia.org/wiki/AHAH).
For the "reported as lame" people: choose your development's shortest mileage. If you see that AHAH will be faster to develop and easier to use, why not just use it? If this HTML code will never change, it may be hard-coded at server side.
Doug Karr replied ago:
Thanks, unchqua for adding this info!
Voters For This Link (8)
Voters Against This Link (0)