I don't understand what this means. Can you please explain how this works?
- In your html, you annotate objects (e.g. a button) with the '.actionable' class
- Then provide a set of arguments in the html alongside, e.g.
<!-- replace #money with the output from /user/3/money/create -->
<input name="type" value="replace" />
<input name="target" value="#money" />
<input name="url" value="/user/3/money/create" />
We're experimenting with a few ways of extending this on Memrise (Spencer Davis gets most of the credit here). It's early days, but we're an ajax-heavy site, and devolving certain kinds of basic, repetitive functionality to html feels natural and simple. And, by adding new handler types to the library, it becomes much, much easier to create reusable widgets that we can sprinkle throughout the site.
P.S. Currently, most of this work is still on a development branch that will be live within a couple of days.
I see the idea:
1) Write htmls (with some rules, e.g. add '.actionable' class)
2) Library turn them to js codes.
1) Write zero js codes.
2) Make basic and repetitive functionalities eaiser.
But, just wondering, why don't you wrap codes which deal with basic and repetitive functionalities into js functions then reuse them, but write a library to turn htmls codes to js codes?
My question is, html has its job and js has its, too. Is it a good idea to mix them?
- Joseph Perla's suggestions are usually good
1) A library that dynamically generated JS for him instead of writing it himself. So probably some scaffolding tool.
2) Server side was returning HTML and not JS
But TBH I didn't really get the paragraphs meaning