[nycphp-talk] JSON and MVC
Christopher Hendry
chendry at gmail.com
Fri Jul 17 20:20:00 EDT 2009
On Fri, Jul 17, 2009 at 11:03 AM, Chris Snyder <chsnyder at gmail.com> wrote:
> On Fri, Jul 17, 2009 at 10:06 AM, Christopher Hendry<chendry at gmail.com>
> wrote:
>
> > I'm curious though about javascript's introspection abilities, might it
> be
> > possible for an element to look into itself (or clone its children) and
> > render from there?
>
> Yes! I've seen schemes that used class names (<span
> class="data_subject">) or custom attributes (data_element="subject")
> like you used in your example. If you've managed to escape the tyranny
> of strict markup, then custom attributes probably make the most sense.
>
Damn the doctype! Must admit, as much as I try, I always end up back at
strict markup.
> > Overall, I still use innerHTML for the most part, unless I'm doing
> something
> > that is strictly key=>values (like select elements) mostly because I'm
> still
> > concerned about the client's parsing abilities. Sure, _we_ all have
> sleek
> > computers and fast browsers, but most people don't. So, yes, offloading
> to
> > the client makes sense (until the next browser comes along and screws
> things
> > up), but as we approach Web 3.0 I'm concerned about
> > request/response/parse/render overhead for the average user - sure it
> > scales, until the next version on windows comes out.
>
> The only disadvantage I've seen to wanton innerHTML replacement is
> that you lose any events or listeners that you might have attached in
> the soup somewhere. Maybe other folks have other reasons, besides just
> an irrational love of DOM methods.
>
>
Again spoiled by Snyder. Good point. I was wondering about this just the
other day - there's no way to force the DOM to refresh itself without
actually refreshing the page?
C
"When you do things right, people won't be sure you've done anything at
all."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090717/c298a06c/attachment.html>
More information about the talk
mailing list