Skip to content

Instantly share code, notes, and snippets.

@drinkmaker
Created September 1, 2013 01:32
Show Gist options
  • Save drinkmaker/6401776 to your computer and use it in GitHub Desktop.
Save drinkmaker/6401776 to your computer and use it in GitHub Desktop.
Проверка подключения jQuery и динамическое его подключение при необходимости.
var jQ = false;function initJQ(){if(typeof(jQuery)=='undefined'){if(!jQ){jQ = true;document.write('<scr'+'ipt type="text/javascript"src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></scr'+'ipt>');}setTimeout('initJQ()',50);}else{(function($){$(function(){
console.log("this is jq");
});})(jQuery);}}initJQ();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment