3 ms·
This isn't reinventing onClick. onClick has several problems. First, it can in theory contain arbitrary JS code and serve as a potential XSS injection vector.
by michaelmior 12y ago
This isn't reinventing onClick. onClick has several problems.
First, it can in theory contain arbitrary JS code and serve as a potential XSS injection vector. Also, as more make the move to blacklist inline JS via Content Security Policy, onClick becomes impossible. Second, onClick requires an explicit receiver.
Part of the benefit of something like JSAction is that it decouples the generation of the event from it's processing. I'm not arguing that JsAction is the best solution for this, but I think the general concept is sound.
- scotty79 12y agoFor me worst part of onclick is putting what's essentially configuration of binding in baroque syntax interspersed with elements that are there for unrelated reasons, in files that have forced structure and are not easy to partition by concern.