Invalid html markup in javascript
Sounds like some javascript got pasted into a rich text editor ("WYSIWYG"), and the result is linebreaks in the JS are being interpreted as content linebreaks and wrapped in &lt;p&gt; container.

Simple fix: edit the content containing the JS, and use the "View Source" button or equivalent to enter the JS in source mode rather than content mode.

More robust approach (less easy to break, etc): add the JS via a custom template (see "Appending jQuery or other code") or from a custom extension.