> Here's another example of the sort of issues I'm dealing with; I'd > appreciate any insight you could offer into how you approach the > problem. So I've got a list on the page, and I'm hooking in Ajax to > append items to that list dynamically. Right now, I've got a partial > that outputs the markup for the list item, and I simply render the > same partial when a JS request comes in. Is that a good approach? Or > should I try to divorce my JS from the back end a little more, by > (say) rendering a generic JSON object when the request comes in, and > then building the DOM elements in the JS's Ajax handler?
I've been wondering that myself. It sounds like it would be better to have a template in client memory that you can clone, fill with JSON data and insert/replace into the DOM. Less bandwidth and server rendering. But it may not be worth the effort unless you can generate that template from a partial one time and store on a js object. Otherwise, there are two templates to maintain: a partial and a js template. Even then, it may not be worth it unless unless its simple to do so, so I've decided to just generate the partial and have the js insert/replace within the DOM. Kevin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/heroku?hl=en -~----------~----~----~----~------~----~------~--~---
