SyntaxError: expected expression, got ‘<'
-
On a page with pricing table there is a javascript error:
SyntaxError: expected expression, got '<'
Plugin is upgraded to the latest version. Short of turning off all plugins how could I find out what is causing this? Edit: fixed, see bottom.
Problem seems to be caused by random p elements in the javascript.
jQuery(document).ready(function($) { </p> <p> $('.ptp-plan').matchHeight(false); $('.ptp-cta').matchHeight(false); $('.ptp-price').matchHeight(false); $('.ptp-button').matchHeight(false);</p> <p> $('.ptp-bullet-item').each(function( index ){ $('.ptp-row-id-'+index).matchHeight(false);</p> <p> });</p> <p> }); </script>
I fixed this by removing all the whitespace in the javascript text string in design1.php file. You really shouldn’t include javascript like this. See also:
https://stackoverflow.com/questions/31340052/wordpress-add-p-tags-to-my-javascript
- The topic ‘SyntaxError: expected expression, got ‘<'’ is closed to new replies.