나는 코드의 몇 가지에 본 적이 그리고 나는 그것이 중요했다 "가정"싶지 않았다 그러나 이것은 Google 웹 로그 분석 코드의 복사본입니다 :이중 스크립트 태그의 값은 무엇입니까?
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-xxxxxx");
pageTracker._trackPageview();
} catch(err) {}
</script>
당신은 거기에 알 수 있습니다 두 개의 열기/닫기 스크립트 태그. 두 개의 다른 스크립트 태그에 코드 비트를 캡슐화하는 것이 유익한 이유가 있습니까? 나의 첫 번째 반응은 단순하게 중복을 제거하는 것이다.