How to embed the following inside a js file
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
You can not embed a JavaScript file in another. But you can load more JavaScript files in dynamically with a function such as this one.
function loadJS(file) {
// Grab the head element
var head = document.getElementsByTagName('head')[0];
// Create a script element
var script = document.createElement('script');
// Set the type
script.type = 'text/javascript';
// Set the source file
script.src = file;
// Add the script element to the head
head.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