在Chrome控制台中包含JavaScript文件 [英] Include javascript file in chrome console
本文介绍了在Chrome控制台中包含JavaScript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一个更简单的(原生或许?)在google chrome浏览器中包含外部脚本文件?
目前我正在这样做:
document.head.innerHTML + =< script src =' http://domain.com/fil.js'> ;</script>; appendChild()
code>是更原生的方式:
var script = document.createElement('script');
script.type ='text / javascript';
script.src ='script.js';
document.head.appendChild(script);
is there a simpler (native perhaps?) way to include a external script file in the google chrome browsers? Currently I'm doing it like this:
document.head.innerHTML+="<script src='http://domain.com/fil.js'></script>";
解决方案
appendChild()
is a more native way:
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'script.js';
document.head.appendChild(script);
这篇关于在Chrome控制台中包含JavaScript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文