I am trying to load an external library to the admin section of my website. On the front end it is pretty easy to load.
<head>
<script src="externalLibrary.com"></script>
<script src="externalLibrary.com"></script>
<script src="externalLibrary.com"></script>
<script src="externalLibrary.com"></script>
<script src="externalLibrary.com"></script>
<script src="externalLibrary.com"></script>
</head>
On the back-end we don't have access to the head section so the library links have to be loaded from an external file.
function myCustomScript($hook) {
wp_enqueue_script( 'admin-js', plugins_url( 'admin-columns/js/admin.js' , dirname(__FILE__) ) );
}
add_action('admin_enqueue_scripts', 'myCustomScript');
The external file loads perfectly, I just need help making the urls available in the external file.
This is what I have tried in the js file
var sc = document.createElement("script");
sc.setAttribute("src", "https://getfirebug.com/firebug-lite.js");
sc.setAttribute("type", "text/javascript");
document.head.appendChild(sc);
document.getElementsByTagName("head")[0].appendChild(sc);