Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Advanced Plugin Concepts: unclear lesson section Give Full Control of Elements #419

Closed
PDMackinnon opened this Issue Sep 13, 2013 · 3 comments

Comments

Projects
None yet
4 participants

https://github.com/jquery/learn.jquery.com/blob/master/page/plugins/advanced-plugin-concepts.md#give-full-control-of-elements

If your plugin creates elements to be used within the DOM, then it's a good idea to offer plugin users some way to access those elements. Sometimes this means giving certain elements IDs or classes. But note that your plugin shouldn't rely on these hooks internally:

A bad implementation:

Perhaps its just me, but I cannot figure what it is that is bad about the implementation that follows. Further, the rest of the section appears to talk up the overall technique. Overall then, I think the text "A bad implementation: " is a mistake, or otherwise should be clarified as why this is bad.

Owner

scottgonzalez commented Sep 16, 2013

It looks like the "bad implementation" is actually the suggested implementation. So I think you're correct that this was a mistake. However, I happen to disagree with this entire section. There's no reason to expose this type of control for generated elements. It's actually a pretty terrible API for users, especially the part where it encourages inline styles set via JavaScript.

Member

arthurvr commented Jan 3, 2015

Can somebody close this down as duplicate of #513? This one is older, but there were comments there, and a PR is open for that issue.

Member

agcolom commented Jan 3, 2015

@PDMackinnon Thanks for reporting this. I'm closing this issue as suggested by @arthurvr as a duplicate of #513

@agcolom agcolom closed this Jan 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment