[whatwg] runat (or "server") attribute
Ian Hickson
ian at hixie.ch
Fri Jun 15 15:19:33 PDT 2012
On Sun, 13 May 2012, Benjamin Hawkes-Lewis wrote:
> On Sun, May 13, 2012 at 1:47 AM, Brett Zamir <brettz9 at yahoo.com> wrote:
> > With Server-Side JavaScript taking off, could we reserve "runat" (or
> > maybe an even simpler and more concise "server" boolean attribute) for
> > a standard and (via CommonJS) potentially portable way for server-side
> > files to be created (and discourage use of HTML-unfriendly and
> > syntax-highlighter-unaware processing instructions)?
>
> "server-side files to be created" - what do you mean?
>
> What would this attribute do?
On Sun, 13 May 2012, Brett Zamir wrote:
>
> So, no matter the Server-side JavaScript engine, one could write code
> like tihs:
>
> <p>You loaded this page on <script server> print(new Date()); </server></p>
>
> which would become:
>
> <p>You loaded this page on Sun May 13 2012 22:33:28 GMT+0800 (China
> Standard Time)</p>
>
> > What would this attribute do?
>
> It would simply be reserved for server-side consumption, whether such
> applications would replace the contents of the tag with HTML or perform
> some non-transparent actions and just remove the tag. It would not do
> anything on the client-side (though it wouldn't need to restrict the
> default behavior either since it really should be consumed by the time
> it reaches browsers). The purpose is simply to allow server-side
> applications (such as within templates) to be able to use one HTML
> syntax portably across other server-side HTML+JavaScript generating
> environments (and also not be concerned that, as with data-* attributes,
> that there might end up being some other future use of the attribute by
> client-side HTML).
We don't have to modify the HTML spec to do this. Since it would be an
extension to HTML for server-specific use, all that needs to happen is for
the server implementors who are interested in doing this to get together
and define an attribute which they then go and support.
--
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg
mailing list