1、chrome浏览器console控台引入外部js文件如

 
<script
src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
在console中输入:
var script = document.createElement('script'); script.src =
"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js";
document.getElementsByTagName('head')[0].appendChild(script);
则在控制台中引入sockjs.min.js文件成功

 

【后续更新,请移步至http://caizhaoke.cn/blogs/zorke/articles/2018/11/17/1542461611996
<http://caizhaoke.cn/blogs/zorke/articles/2018/11/17/1542461611996>】