我的浏览器 Web 控制台中不断出现 JS 错误,我已经能够清理一些错误,但我似乎越努力越会崩溃。我并不是最有经验的 JavaScript 编码人员,我只是不知道如何解决这个问题以防止我的客户网站上出现进一步的问题。
任何关于我能做什么的帮助或见解将不胜感激!
[21:34:36.569] TypeError: $ 不是函数@ http://bolivares.com/shop/aurelio-tank-baby-blue/:103
http://bolivares.com/shop/aurelio-tank-baby-blue/
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-35293709-1']);
_gaq.push(['_trackPageview']);
(function() {
var 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';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
/* <![CDATA[ */
// call fancybox
function openFancy(){
setTimeout( function() {$('#autoStart').trigger('click'); },3000); // show after a second
}
// create cookie on button click
function dontShow(){
$.fancybox.close(); // optional
$.cookie('cookie1', 'yes', { expires: 30 }); // expiration in 30 days
}
function askLater(){
$.fancybox.close(); // optional
$.cookie('cookie2', 'yes', { expires: 7 }); // expiration in 30 days
}
</script>
<script>
$(window).load(
function() {
var visited = $.cookie('cookie1') || $.cookie('cookie2') || $.cookie('cookie3'); // create cookie 'visited' with no value
if (visited == 'yes') {
return false;
} else {
openFancy(); // cookie has no value so launch fancybox on page load
$.cookie('cookie3', 'yes', { expires: 3 }); // expiration in 30 days
}
$('#autoStart').fancybox();
function toggleStuff(){
$('li.toggle-content').hide();
$('h4').click(function() {
$(this).find('ul').slideToggle();
});
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 590,top = 275');");
}
});
</script>