var head = document.getElementsByTagName(‘head‘)[0]; var script = document.createElement(‘script‘); script.src = ‘/js/feature.js‘; head.appendChild(script); script.onload = function() { // 现在可以调用脚本里定义的函数了 }
原文:http://www.cnblogs.com/ytfcz/p/5204059.html