var imported = document.createElement('script'); imported.src = '/path/to/imported/script'; document.head.appendChild(imported);