re: A JavaScript-Free Frontend VIEW POST


Hello, I have looked at an invoice page code source. And I have a question : it appears you have a script tag with a JSON description of the invoice. How do you map this data to every invoice line input ? I thought it would be server generated !?
Great example of frugality, should always be a first choice way to do webapp.
Keep on this attitude.


The server renders the HTML page and inserts some simple JSON so that Mithril can pick up on the data and populate the drag-and-drop UI. When the invoice is sent or otherwise not editable, the server skips the JSON and Mithril is not used, so the server just renders the full HTML for the line items.

code of conduct - report abuse