Wednesday, 15 February 2012

jQuery declaring function in noConflict environment -



jQuery declaring function in noConflict environment -

is there way utilize $ instead of jquery within of declared function, not within of jquery(document).ready when in noconflict??

sample code:

jquery(document).ready(function($){ $('.button').click(function(e) { e.preventdefault(); some_function($(this)); homecoming false; }); }); function some_function(el) { var id = jquery(el).attr('href'); }

i love utilize $ instead of jquery within some_function.

function some_function(el) { var $ = jquery; var id = $(el).attr('href); }

but @ rate, why bother $.noconflict?

jquery

No comments:

Post a Comment