when i do code that will be used by others i do something like this:
(function(){
var $ = document.id || $;
// use $
})();
this grants compatibility with previous versions than 1.2.3 and uses
document.id in case it exists.
--
Fábio Miranda Costa
Solucione Sistemas
Engenheiro de interfaces
On Sat, Nov 28, 2009 at 12:58 AM, Aaron Newton <[email protected]> wrote:
> I still use $ whenever I'm working on code for a specific project that I
> don't plan on ever releasing as a plugin...
>
>
> On Fri, Nov 27, 2009 at 5:05 PM, rpflo <[email protected]> wrote:
>
>> When document.id showed up I updated my classes, of course, but I
>> still use $ when I'm outside of a class.
>>
>> I much prefer to read document.id, with textmate snippets I type `di +
>> tab` so there's no typing issue, and lastly there's a distinction-from-
>> other-frameworks element about it that has major appeal for me.
>>
>> Is there an emerging best practice or style?
>>
>
>