jQuery syntax
-
Hi,
We are experiencing some really strange behaviour with a jQuery script.
We are using the following script to toggle the sidebar (collapsed/not collapsed) on mobile devices.<script>
jQuery(document).ready(function($){
jQuery(‘#showfilter’).on(‘click’, function(){
jQuery(‘#secondary’).toggleClass(‘show’);
});
)};
</script>Notice the )}; at the end.
It isn’t working with the correct syntax }); but when we change } and ) the script works fine.
JS console is prompting the syntax error (Uncaught SyntaxError: Unexpected token ‘)’ ), but the script is still working.Any idea on why this is happening?
You’ll have to look at the page with screen width smaller than 991px.
The page I need help with: [log in to see the link]
- The topic ‘jQuery syntax’ is closed to new replies.