Pajama.js - because HTML has no place in your Javascript app
1–10 of 18 posts
Re: Pajama.js - because HTML has no place in your Javascript app
#2Re: Pajama.js - because HTML has no place in your Javascript app
#3Re: Pajama.js - because HTML has no place in your Javascript app
#4No. It's obfuscating HTML with a JS wrapper.
http://www.ractivejs.org/ (also currently on the front page) uses a pattern that reduces friction while keeping responsibilities where they belong, i.e. HTML for markup and JS for interactivity.
Re: Pajama.js - because HTML has no place in your Javascript app
#5Re: Pajama.js - because HTML has no place in your Javascript app
#6Re: Pajama.js - because HTML has no place in your Javascript app
#7Re: Pajama.js - because HTML has no place in your Javascript app
#8Sad to say but it doesn't add much value and it makes certain tasks harder even. For instance it makes it very hard (or almost impossible) to use that same html templates on the backend and on the frontend side of things.
pajama.js (pjs) is a serverside and clientside templating engine...
GitHub only has the first commit so I don't think it is production ready but I find the idea to be novel and interesting.P.S. The on http://www.pajamajs.com/ is not set yet.
Re: Pajama.js - because HTML has no place in your Javascript app
#9I'd also like to point out that in a good portion of JS projects HTML and JS have a symbiotic relationship so the notion that you have to scrub out all the HTML as "best practice" is entirely incorrect in my eyes, thus the failing/winning example makes no sense without context. Is that HTML pre-baked into the page by the server? Then it makes complete sense to be that way. Are you hand generating it from strings? Not ideal, but there are tons of far more elegant ways to solve that already and they don't require you to still be writing HTML in your JS (even if it looks like JSON it still has a single purpose and is wedged directly into your code).
At least existing templating solutions call out to external templates in locations where the HTML "should be".