|
|
Home / Groups / Ajax
New Ajax examples?Mike, besides the responses from Zaphod and Todd so far, let me clarify as well that I think the use of JS being described isn't *quite* the same as "passing back HTML". In the latter case, as you say, you're then just plunking the HTML onto the page, and as has been said some feel that's a blurring of the lines between presentation and logic. Rather, the notion of JS use being described here is more just as a means of packaging the data to be transmitted back and forth. Just as XML is one way (and indeed in the Flash world AMF is another), in this case the JS isn't presentational JS but instead is representing the data sent from the server in a JS way. That can then be processed on the browser (much like you may have processed XML before, but perhaps more easily) and then from it the presentation can be rendered (with DHTML on the browser, as one would do otherwise). One way to view it as a spectrum: on one end, one sends only XML and processes it on the browser; on the other, one sends HTML and shows it on the browser. In the middle, closer to the use of XML, one sends JS objects to represent the data (and in CF that can be created with WDDX, or using one of the JSON-based libraries). Hope that's helpful. Like so many subjects in computing, there are many ways to slice a cake, and simple solutions while appealing often lose flexibility, performance, reusability. One has to weigh all the pro's and con's. Many of these have been discussed often before with respect to passing data back and forth to the browser. It's just that Ajax has brought many people to the discussion again. It will take time for old lessons learned to be re-learned by the new crowd. Charlie Arehart CTO, New Atlanta Communications, makers of BlueDragon (678) 256-5395 charlie@newatlanta.com www.newatlanta.com/bluedragon/ > How is passing the actual javascript better than passing back > the actual content? > > I'm curious because we did a small project by passing XML, > but it became a big project because of that. > > Now, I'm toying with the idea of passing back HTML and just > setting the ..innerHTML property where it needs to appear. > > If passing js, rather than HTML, is better for some reason, > then I may switch to that method. > > Thanks > M!ke |
Mailing Lists
|
Latest Fusion Authority Articles
|