Last active
April 1, 2023 02:44
-
-
Save tevashov/5172451 to your computer and use it in GitHub Desktop.
jQuery latest hotlink #jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js" ></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Adapted from https://codingbeautydev.com/blog/javascript-create-script-element/
const script = document.createElement('script');
// use local file
// script.src = 'script.js';
script.src =
'http://code.jquery.com/jquery-latest.min.js';
script.async = true;
// make code in script to be treated as JavaScript module
// script.type = 'module';
script.onload = () => {
console.log('Script loaded successfuly');
const box = document.getElementById('box');
box.textContent = 'The script has loaded.';
};
script.onerror = () => {
console.log('Error occurred while loading script');
};
document.body.appendChild(script);
//Compressed:
const script = document.createElement('script');
script.src = 'http://code.jquery.com/jquery-latest.min.js';
script.async = true;
document.body.appendChild(script);