Live data from Hacker News

Pajama.js - because HTML has no place in your Javascript app

pajamajs.com

11–18 of 18 posts

Re: Pajama.js - because HTML has no place in your Javascript app

#15
post #14

We had a problem, we hid it under a layer of abstraction, now we have a hidden problem.

We don't have the same problem then. Personally what I hate when I include HTML in my JS is that if I want to include/exlude an attribute/node/text based on a condition/variable, it become a big huge and ugly. This make it a little bit prettier.

Re: Pajama.js - because HTML has no place in your Javascript app

#16
post #13

plucking elements out of the DOM using selectors isn't far away from using global variables in C. But at some point underneath all the abstraction, isn't that exactly what this has to do to even work?

I don't think that's quite how it works. I took a quick look at the code and it doesn't contain any DOM selectors at all. It uses closures and getters and setters.

Re: Pajama.js - because HTML has no place in your Javascript app

#17
post #16
post #13

plucking elements out of the DOM using selectors isn't far away from using global variables in C. But at some point underneath all the abstraction, isn't that exactly what this has to do to even work?

I don't think that's quite how it works. I took a quick look at the code and it doesn't contain any DOM selectors at all. It uses closures and getters and setters.

Huh?

Well if i'm wrong, i'm wrong. I should probably study it some then.

Re: Pajama.js - because HTML has no place in your Javascript app

#18
post #17
post #16

Earlier quoted context omitted.

I don't think that's quite how it works. I took a quick look at the code and it doesn't contain any DOM selectors at all. It uses closures and getters and setters.

Huh? Well if i'm wrong, i'm wrong. I should probably study it some then.

It's actually quite neat the way it all works. It's definitely worth taking a look at!
Post reply on HN