Answers.Body: <p>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 <code>&lt;p&gt;</code> container.</p>
  
  <p>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.</p>
  
  <p>More robust approach (less easy to break, etc): add the JS via a custom template (<a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Page+Templates" rel="nofollow noreferrer">see "Appending jQuery or other code"</a>) or from a custom extension.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T23:40:58.067Z
Answers.Text: If this is not the cause, it's possible the site is using a theme or plugin which post-processes CiviCRM's output and is not doing so cleanly.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T14:50:50.943Z
Answers.Text: Thanks, These two causes were what I was thinking of as well. I currently don't have access to the file system of the server. I'm thinking of trying:
  
  1. temporarily try a different template (I'm betting this fixes it)
  2. ask those who do have access to either give me access or to let me know if there are any over ride files in civicrm's provisioned custom script directory.
Answers.UserDisplayName: Jay Edgar
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T21:46:37.787Z
Answers.Text: My first proposal should be something you can check through web UI, by editing the Contribution page (or other entity with editable field) affected. Good luck!
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-14T22:37:02.160Z
Answers.Text: Changing the template fixed it. Now I just need to recreate the original template or figure out what is wrong with it.
Answers.UserDisplayName: Jay Edgar
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T23:37:05.580Z
Answers.LastActivityDate: 2016-12-13T23:37:05.580Z
Answers.UserDisplayName: Chris Burgess
Body: <p>I've been asked to take a look at a civicrm installation on wordpress. They are having trouble getting an event page to work correctly. I found that there are lots of javascript errors being thrown. When I look at the page source of the registration page I see lots of p and /p tags in with the javascript which is causing script errors. e.g.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;&lt;/p&gt;
  &lt;p&gt;var thousandMarker = ',';
  var separator      = '.';
  var symbol         = '$';
  var optionSep      = '|';&lt;/p&gt;
  &lt;p&gt;cj("#priceset [price]").each(function () {&lt;/p&gt;
  &lt;p&gt;    var elementType =  cj(this).attr('type');
     if ( this.tagName == 'SELECT' ) {
        elementType = 'select-one';
     }&lt;/p&gt;
  &lt;p&gt;    switch(elementType) {
  </code></pre>
  
  <p>The first line throws an error of SyntaxError: expected expression, got '&lt;'</p>
  
  <p>Any idea what could be causing this? I'm not very familiar with wordpress. I reviewed the plugins they have and don't see anything obvious. (They are running wordpress 4.7 and civicrm 4.7.13).</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-14T03:31:37.007Z
Comments.Text: have you compared this with what you get on the WP civicrm demo site?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-15T14:12:45.883Z
Comments.Text: No real reason to. Its obviously invalid scripting. I've temporarily changed their template and the problem went away. Its something with their template.
Comments.UserDisplayName: Jay Edgar
Tags: <wordpress><error><html>
Title: Invalid html markup in javascript
ThreadText: # Invalid html markup in javascript
  
  (Asked by: username_0 on 2016-12-13)
  
  I've been asked to take a look at a civicrm installation on wordpress. They are having trouble getting an event page to work correctly. I found that there are lots of javascript errors being thrown. When I look at the page source of the registration page I see lots of p and /p tags in with the javascript which is causing script errors. e.g.
  
  **Tags:** wordpress, error, html
  
  > **Comments:**
  > **username_1**: have you compared this with what you get on the WP civicrm demo site?  
  > **username_0**: No real reason to. Its obviously invalid scripting. I've temporarily changed their template and the problem went away. Its something with their template.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-12-13. Score: 1
  
  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  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"](https://wiki.civicrm.org/confluence/display/CRMDOC/Page+Templates)) or from a custom extension.
  
  > **Comments:**
  > **username_2**: If this is not the cause, it's possible the site is using a theme or plugin which post-processes CiviCRM's output and is not doing so cleanly.  
  > **username_0**: Thanks, These two causes were what I was thinking of as well. I currently don't have access to the file system of the server. I'm thinking of trying:  1. temporarily try a different template (I'm betting this fixes it) 2. ask those who do have access to either give me access or to let me know if there are any over ride files in civicrm's provisioned custom script directory.  
  > **username_2**: My first proposal should be something you can check through web UI, by editing the Contribution page (or other entity with editable field) affected. Good luck!  
  > **username_0**: Changing the template fixed it. Now I just need to recreate the original template or figure out what is wrong with it.  
  
  ---
  
  