Inside your wrapper ( (function() { ... })() ) you define the jQuery variabele variable for a copy of the jQuery191 variable in the global scope.
This means that $.getScript does not use this variable, but calls jQuery.getScript . Since this is an anonymous function, $ inside the shell now refers to an external variable $ (in this case $ in a global object). You can solve this by renaming the first parameter of your wrapper to $ :
(function ($) { $.getScript('foo.js'); })(window.jQuery191);
Or adding this to your wrapper:
var $ = jQuery
Now both $ and jQuery contain a copy of the jQuery191 global scope variable.
source share