Advertisement
nrzmalik

AI ChatBoat Custom JsLib for Articulate Storyline

Jul 18th, 2023 (edited)
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.55 KB | Source Code | 0 0
  1. function isScriptAlreadyIncluded(src) {
  2.   return document.querySelectorAll(`script[src="${src}"]`).length > 0;
  3. }
  4.  
  5. function loadScript(src) {
  6.   if (!isScriptAlreadyIncluded(src)) {
  7.     const script = document.createElement('script');
  8.     script.src = src;
  9.     script.async = true;
  10.     document.head.appendChild(script);
  11.   }
  12. }
  13.  
  14. const jquerySrc = 'https://code.jquery.com/jquery-3.6.0.min.js';
  15. const customLibSrc = 'https://cdn.jsdelivr.net/gh/nrzmalik/StorylineChatBot/nrzmalikStorylineChatBoat.js';
  16.  
  17. loadScript(jquerySrc);
  18. loadScript(customLibSrc);
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement