if you pass in a jquery selector that does not exist, a js error results. #1
|
I can confirm this bug. |
|
I'll get this done asap, originally I left it this way because I was afraid of failing silently on a situation like this, but considering jQuery does that a lot, I think it'll be fine. |
|
Thank you Ariel. BTW, thanks for this awesome jquery plugin. |
|
@flesler You could do something I borrowed from jquery cycle, i.e. use a safe console.log call to write that no element where found using the provided selector. |
|
Can you confirm 747f077 fixes the issue in your page? |
|
Just by reading the code, it should ! |
|
747f077 had a bug, just added a new commit to address it. |
|
@flesler Passing null to jQuery works, so it should not break the plugin neither.
|
|
Do you think passing a null target is a valid "intention"? as in, a On Wed, Aug 22, 2012 at 2:07 PM, Nicolas Brassard
Ariel Flesler |
|
@flesler First of all, I have written a lot of jQuery plugins, I and always try to implement the same behavior as jQuery did. If jQuery have a certain behavior (even if it's weird one) I try to cope with it in order to make the use of the plugin as easy as jQuery itself. So just for that reason, I would allow On top of this, passing a null could be a valid intention. I build a lot of complex app, based on CMSes. Let say I give the ability to the user of the CMS to specify some selectors in a field, and that this field is non mandatory. Suppose I output this value as a Less line of code means better maintainability. :) But in the end, it's your choice ! |
|
Well, the data() example is a valid one I think. I'll add the change On Wed, Aug 22, 2012 at 4:11 PM, Nicolas Brassard
Ariel Flesler |
|
Great :) Thank you ! Making a nice API (or plugin in this case) makes you responsible for checking all possibles inputs. |
TypeError: Cannot read property 'slice' of undefined