Javascript syntax errors – need two semicolons
-
In the includes/js/scripts.js there are two syntax errors because of missing semicolons. Here is the section of code with the fix indicated. Because of the new lines, the loose interpretation of browsers works, but when you minify the code it breaks. jsl (js lint) also finds the errors.
wpcf7.notValidTip = function( target, message ) { var $target = $( target ); $( '.wpcf7-not-valid-tip', $target ).remove(); $( '<span role="alert" class="wpcf7-not-valid-tip"></span>' ) .text( message ).appendTo( $target ); if ( $target.is( '.use-floating-validation-tip *' ) ) { var fadeOut = function( target ) { $( target ).not( ':hidden' ).animate( { opacity: 0 }, 'fast', function() { $( this ).css( { 'z-index': -100 } ); } ); }; // **added missing semicolon here** $target.on( 'mouseover', '.wpcf7-not-valid-tip', function() { fadeOut( this ); } ); $target.on( 'focus', ':input', function() { fadeOut( $( '.wpcf7-not-valid-tip', $target ) ); } ); } }; // **added missing semicolon here**
The topic ‘Javascript syntax errors – need two semicolons’ is closed to new replies.