title: Lazy load javascript file
body: <p>I'm trying to implement a Microsoft botframework chatbot on our site but don't want to burden the users who won't engage with the bot with the 470Kb library unless they choose to start a chat.</p>
  
  <p>When the framework is included in the page source, the bot initialises and launches but when I remove this from the page source and instead write it to the page when the user clicks a button to start the bot, the script is written to the page and can be seen in DevTools sources but does not initialise.</p>
  
  <p>I've tried several methods of delaying the initialisation until after the script has downloaded, but none of these have worked whether the script is hosted locally or from the MS CDN <a href="https://cdn.botframework.com/botframework-webchat/latest/botchat.js" rel="noreferrer">https://cdn.botframework.com/botframework-webchat/latest/botchat.js</a>.  </p>
  
  <p>Even manually checking for the BotChat object in console returns BotChat is not defined.</p>
  
  <p>Is it possible to lazy load the framework after page load?</p>
  
  <p><a href="http://demo.icaew.com/peter-gibb/global-front-end/html/corporate/berzerk.html" rel="noreferrer">http://demo.icaew.com/peter-gibb/global-front-end/html/corporate/berzerk.html</a></p>