所以我想在一个网站应用程序中启用google分析,所以我在script标记本身就有了代码。是否最好将代码直接放在标记中:
<script>
(functions(variables)google objects (morevariables), links);
</script>还是以以下形式进行比较好:
<script src="link to where a js file with the exact same code as above is hosted"></script>考虑到三件事:
发布于 2016-02-17 13:40:06
根据我的经验,您更喜欢将脚本放在单独的文件中,以便在我的所有视图中重用它。但我不认为这有什么区别。
https://stackoverflow.com/questions/35457889
复制相似问题