Description
http://learn.jquery.com/plugins/advanced-plugin-concepts/#give-full-control-of-elements
I had a hard time figuring out what this section was trying to highlight.
The confusing part is where it says:
"A bad implementation: "
// Plugin code:
....actual code
// Retain an internal reference:
....actual code
That looks like the whole block of code (including two parts with heading comments) is supposed to be the example of bad implementation (and the code doesn't make much sense alltogether), and then one expects the rest of the text to explain what's wrong in it and how to improve it.
Instead, the first part of the code under the comment "//Plugin code" is the bad implementation, and the second part starting with the comment "//Retain an internal reference:" is already the improved code that replaces the previous one. That's not clear at all.
This could be improved for example like this:
"""
A bad implementation:
// Plugin code:
....actual code
A better implementation:
// Retain an internal reference:
....actual code