use jQuery instead of $ #63

Open
jakobg opened this Issue Sep 10, 2014 · 2 comments

Projects

None yet

3 participants

jakobg commented Sep 10, 2014

Hi there,

in the jQuery version you should use "jQuery" instead of its short version "$". the short version could be overwritten by other libraries.

Thanks,

Jakob

caiorg commented Oct 3, 2014

To prevent this behaviour, you could use encapsulation.

Like this:

(function($) {
    $(function(){ //shorthand for $(document).ready(function(){});
        // do your magic here
    });
)(jQuery);
Owner

Thank you for brining this to my attention. The UMD wrapper used in the jquery version should actually be able to handle this. Unfortunately it is referencing jQuery rather than $. Change should not be horribly difficult.

https://github.com/firstopinion/formatter.js/blob/master/src/tmpls/jquery.hbs#L20
https://github.com/firstopinion/formatter.js/blob/master/dist/jquery.formatter.js#L29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment