Hi Bertrand, > ...1. would it be better to produce output like: > > <p class=" > > document.write(item.color); > > "\">" > > document.write(item.text); > > </p> > > So that e.g. search engines could index the static parts?... > > Can you give a more complete example? The above is not valid > html/javascript code, I see what you mean but I'm not sure exactly how > you envision it.
I meant to covert just the stuff within the <%%> brackets into document.write() and leave the rest untouched. So, your example would produce sthg like: <p class="<script>document.write(item.color)</script>"><script> document.write(item.text)</script></p> I am not sure if this is a good idea, but on first glance it seems more natural to me. > ...2. Having the same templating language on client and server is nice, > but > > maybe different delimiters would be a good idea. If the same ones are > used > > we cannot combine server-side and client-side parts in one script.... > > Do you have an example use case for mixing server-side and client-side > templating? I agree that that might be cool, but the downside is the > possible confusion with different sets of delimiters. So I'd like to > make sure this is not YAGNI. >From the ever-popular blog example: A blog where the posts are filtered on the server-side (using some criteria like date, author, etc) but sorting is done on the client (so that a change of sorting criteria does not result in another request).
