title: How to use sweetalert in a .js file
body: <p>So I have a .js file, and I'm trying to throw a message to the user using sweetalert. Moreover, I also want to load .js and .css files of sweetalert, dynamically inside the .js file. </p>
  
  <pre><code> // Load script
   var filerefjs = document.createElement('script');
   filerefjs.setAttribute("type", "text/javascript");
   filerefjs.setAttribute("src", "../../rotateScreen/dist/sweetalert.min.js");
  
   // Load CSS file
   var filerefcss = document.createElement("link");
   filerefcss.setAttribute("rel", "stylesheet");
   filerefcss.setAttribute("type", "text/css");
   filerefcss.setAttribute("href", "../../rotateScreen/dist/sweetalert.css");
  
    if (window.innerHeight &lt; window.innerWidth){ 
  
        window.onload = function(){
          document.getElementById('b6').onclick = function(){
             swal({title: "",   text: "Message", 
                  imageUrl: "../../rotateScreen/example/images/rotate.png", confirmButtonText: "OK"});
          };
        } 
  
     } // if
  </code></pre>
  
  <p>I don't get any errors, but the alert-box does not appear on the screen . </p>