user3219961 user3219961 - 1 month ago 21
HTML Question

SyntaxError: missing } after function body, one server good, live server fail

I can't figure out what is happening, I have this staging site http://eggsfruits.techqueb.com/midi.php were i did put tabs code and javascript. It is doing the process A1, when i upload my file to my live server http://www.eggsfruits.ca/midi.php the tabs does not work anymore and I get the error SyntaxError: missing } after function body

Can you please give me an hand on finding my issue

Answer

your script

jQuery(document).ready(function() {jQuery('.tabs .tab-links a').on('click', function(e){var currentAttrValue = jQuery(this).attr('href');// Show/Hide Tabs jQuery('.tabs ' + currentAttrValue).show().siblings().hide(); // Change/remove current tab to active jQuery(this).parent('li').addClass('active').siblings().removeClass('active'); e.preventDefault(); });

as you can see, you didnt close the function because you commend it.

so i think your code should be like this :

jQuery(document).ready(function() {jQuery('.tabs .tab-links a').on('click', function(e){var currentAttrValue = jQuery(this).attr('href'); });// Show/Hide Tabs jQuery('.tabs ' + currentAttrValue).show().siblings().hide(); // Change/remove current tab to active jQuery(this).parent('li').addClass('active').siblings().removeClass('active'); e.preventDefault();