views:

215

answers:

1

Which casing looks better to you for a jQuery plugin:

$("#foo").runMyPlugin();

or

$("#foo").runmyplugin();

Is there a naming convention for jQuery that prefers on over the other?

Thanks in advance!

+1  A: 

I would recommend you the first one, that convention is widely used in JavaScript, even in the core language by itself, the ECMA Specification uses it, e.g.

Array.prototype.toLocaleString
Object.prototype.hasOwnProperty
Object.prototype.propertyIsEnumerable
// etc...

All identifiers are named with camelCase, and only constructor functions are named with the first letter as capital (PascalCase).

CMS
Those examples look more like the first one?
Marc
Yes, the first one... my mistake...
CMS