javascript - Yepnope is not working as expected -
i using yepnope in project .i want load needed js , css files in page .but yep nope not working expected.
my codes are
$(document).ready(function(){ yepnope([{ // load jquery 3rd party cdn load: 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js', callback: function (url, result, key) { if (!window.jquery) { yepnope('3rdparty/js/jquery2.1.4.js'); } } }]); })
but not load can possible solution?
i believe trying use jquery before load yepnope, try putting script @ end of dom, before closing body tag follows:
yepnope([{ // load jquery 3rd party cdn load: 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js', callback: function (url, result, key) { if (!window.jquery) { yepnope('3rdparty/js/jquery2.1.4.js'); } } }]);
if see, i've removed document ready event because it's done jquery, , loading jquery within yepnope. thing, getting error in console? maybe $ not defined
?
Comments
Post a Comment