我正在尝试使用JSLint验证我的Google Analytics代码,但是我收到了很多错误消息:
代码:
/*global document */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24389816-1']);
_gaq.push(['_trackPageview']);
(function () {
var s,
ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
}());
Run Code Online (Sandbox Code Playgroud)
错误消息:
第2行第5个问题:'_gaq'中出现意外悬空'_'.
var _gaq = _gaq || [];
第2行第12个问题:'_gaq'中意外悬空'_'.
var _gaq = _gaq || [];
第3行的问题1:'_gaq'中出现意外的悬空'_'.
_gaq.push(['_ setAccount','UA-24389816-1']);
第4行的问题1:'_gaq'中出现意外的悬空'_'.
_gaq.push([ '_ trackPageview的']);
怎么了?谢谢.