Версия 18:58, 19 апреля 2022 | | Версия 19:00, 19 апреля 2022 |
Строка 4: | | Строка 4: |
| document.getElementsByTagName('head')[0].appendChild(script); | | | document.getElementsByTagName('head')[0].appendChild(script); |
| } | | | } |
? | if(!window.jQuery) {include("https://code.jquery.com/jquery-1.12.4.min.js");} | | + | if(!window.jQuery) { |
| | + | console.log('include jQuery'); |
| | + | include("https://code.jquery.com/jquery-1.12.4.min.js"); |
| | + | } |
Версия 19:00, 19 апреля 2022
function include(url) {
var script = document.createElement('script');
script.src = url;
document.getElementsByTagName('head')[0].appendChild(script);
}
if(!window.jQuery) {
console.log('include jQuery');
include("https://code.jquery.com/jquery-1.12.4.min.js");
}