@Steven Sanderson: "In your example, to fit the normal MVVM pattern,
you can send the initial model state to the client as JSON data, then
have the UI generated from that."
But that's exactly the point, as that wouldn't "progressively enhance"
the DOM. It's only MVVM if there's JS, otherwise it's just, well,
blank. You're absolutely right about the sophisticated behaviour being
a pain to do with POSTed forms, but I do work on a couple of mobile
web-apps, where JS is (still) not a given. And
@Mark Bradley: "If they are equivalent and you do it in the right way
there shouldn't be any indication on the user side".
Exactly, but implementing this might be harder than it looks (what is
equivalent?). On the other hand, say you have an element like in my
example (one with a bound template):
<ul data-bind="template: { name: 'friendsTemplate', foreach:
friends }">
<!-- We're going to pretend there are still people out there
with no JS! The thought! -->
<li>Bob</li>
<li>Fred</li>
</ul>
Wouldn't it be an idea to replace the contents of an element with a
bound template and regard the existing contents as fallback content? I
think it fits in neatly with the existing idea of fallback content in
HTML.
@rpn: "This is maybe a little bit off topic, but you can get creative
with bindings to actually populate your viewModel from the existing
content."
I did think of that as well, but came to the conclusion that it kind
of defeats the purpose. You lose all the good things JSON has and
introduce so many potential points of failure. I've done a fair bit of
screen-scraping (in JS!) but it's very error-prone.
I don't think creating a full HTML view and loading the initial data
(using JSON) is a problem in an MVC environment from any performance
point of view and I do still like the thought of progressive
enhancement more than depending on JS. It's a tiny bit academic,
though.
PS Sorry for responding so late, forgot to subscribe to the thread
initially.