So, I have my main custom_js.js as shown below:
(function ($, root, undefined) {
$(function () {
'use strict';
//js goes here
// Default line End
});
})(jQuery, this);
Now, I have an external js file from blazy lazy load.
I tried to put the code in my custom_js.js as below (by just copying and pasting)
(function ($, root, undefined) {
$(function () {
'use strict';
//blazy v.1.5.1
(function(k,f){"function"===typeof.....
// Default line End
});
})(jQuery, this);
But I am getting an error (that "blazy" was not found).
I am simply trying to consolidate the external js into my custom_js file.
What am I doing wrong?
EDIT:
This is the setup:(Everything in footer)
Using the external js.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://raw.githubusercontent.com/dinbror/blazy/master/blazy.min.js"></script>
<script type="text/javascript" src="http://example.com/js/custom_js.js"></script>
blazy.min.jsAND copy & pasting it into your owncustom_js.js? Just includingblazy.min.jsis enough.blazycode in yourcustom_js.jsor where you are trying to useblazy?custom_js.js(See the accepted answer). it works now =)