Im trying to integrate a firebase config into my js file rather than directly into html file. Given:
<script src="https://www.gstatic.com/firebasejs/3.4.0/firebase.js"></script>
<script>
  // Initialize Firebase
  var config = {
  .......
  }
</script>
and my js file:
$(function() {
......
}
how can I integrate the line <script src="https://www.gstatic.com/firebasejs/3.4.0/firebase.js"></script> into my js file ?
You can create a tag script and append to body of document.
var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://www.gstatic.com/firebasejs/3.4.0/firebase.js';
    document.body.appendChild(script);
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With