You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
https://github.com/jquery/learn.jquery.com/blob/master/page/plugins/advanced-plugin-concepts.md#give-full-control-of-elements
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.
The text was updated successfully, but these errors were encountered: