Skip to content

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

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@PDMackinnon
Copy link

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.

@scottgonzalez
Copy link
Member

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.

@arthurvr
Copy link
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.

@agcolom
Copy link
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 as completed Jan 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants