4 ms·
The first line of $.fn.wTooltip is if(typeof option === 'object') Does anyone know where option is declared and where its value is set?
by AndrewHampton 15y ago
The first line of $.fn.wTooltip is
if(typeof option === 'object')
Does anyone know where option is declared and where its value is set?
- rduchnik 15y agoMy bad, fixed it, was supposed to be here: $.fn.wTooltip = function(option, settings)
- ftyhgjn 15y ago'Untested' and 'superior' are not happy bedfellows!
- rduchnik 15y agolol, just a typo ;)
- axiak 15y agoWhat happens if I type: $("blah").wTooltip(new String("color")); In my recent jquery plugin I considered doing a typeof check myself but decided against it since it was too brittle. I instead checked to see if the options was === what I expected it to be first.
- rduchnik 15y agoWell, I think this is getting a little nit picky. I would rather have a smaller footprint for my plugin then putting a bunch of checks like this in. I don't think I've ever passed in a string that way, that would seem to me like a very rare condition.
- lhorie 15y agoIt's meant to be the first argument passed to the plugin, e.g. $("#bla").wTooltip({foo: "bar"})