Live data from Hacker News

Show HN: Marginotes, quick and elegant side notes for your paragraphs

github.com

1–10 of 31 posts

Re: Show HN: Marginotes, quick and elegant side notes for your paragraphs

#6
Looks nice!

I was a little surprised at the last line in your code:

window.jQuery.prototype.marginotes = window.$.prototype.marginotes = marginotes

Last I checked (one minute ago) jQuery and $ refer to the same object. jQuery === $ unless somebody is using $ to refer to something else in which case thanks you just clobbered $'s prototype. You should follow the jQuery conventions https://learn.jquery.com/plugins/basic-plugin-creation/

Re: Show HN: Marginotes, quick and elegant side notes for your paragraphs

#7
post #2

http://youmightnotneedjquery.com/

What do you consider a reasonable reason to build something as a jQuery plugin as opposed to pure-js? or do you believe jQuery plugins are redundant by default? Just interested.

I personally find it odd to create every component as a jquery plugin. To me, it makes more sense to write a plugin only when you're extending jquery core functionality itself in some way.

As far as "extending" goes though, it's not always clear. Is a date picker extending jquery's core? I personally think not, but there has evolved an expectation that every web component must be initialized like so:

$('#container').doSomething();

So I suppose a lot of people do it that way just to have a familiar look to their API, or even just to show up in listing as a jquery plugin.

Post reply on HN