var script = document.createElement('script'); script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(script);