jQuery noob checking in here. What is wrong with my syntax? I get Unexpected End of Input in Chrome console.
<script>
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
</script>
It means you've forgotten a closing }, ), >, or whatever is used in its syntax. Check all of your blocks and statements to see if you've left out any closing mark.
if you copy your code into jsbeautifier.org, click on "Beautify" and see if all of the indentations are correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With