What's the proper way to use jQuery in conjunction with 'use strict'?

deltanovember picture deltanovember · Apr 21, 2012 · Viewed 7.6k times · Source

If I have something like the following

"use strict";

$(document).ready(function () {

});

I get the warning

'$'is not defined

Answer

Florian Margaine picture Florian Margaine · Apr 21, 2012
( function ( $ ) {
    'use strict';
    $( document ).ready( function () {
        console.log( 'working!' )
    })
} ( jQuery ) )