title: Uncaught SyntaxError: Unexpected token ILLEGAL Wordpress
body: <p>This code is working fine outside wordpress but Wordpress shows follwing error and does nothing. Can anyone tell the reason?
  Thanks</p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Unexpected token ILLEGAL
    custom_params.js:2Uncaught TypeError: Object # has no method
    'prettyPhoto'
    chrome-extension://mpcddcfoblbgmnaklcpkbfajnfikinhn/videodownload.js:5Uncaught
    TypeError: Cannot read property '0' of null
    3/wordpress/?page_id=458:169Uncaught ReferenceError: addInput is not
    defined</p>
  </blockquote>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var counter = 1;
  var limit = 3;
  function addInput(divName){
       if (counter == limit)  {
            alert("You have reached the limit of adding " + counter + " inputs");
       }
       else {
            var newdiv = document.createElement('div');
            newdiv.innerHTML = "Entry " + (counter + 1) + " &lt;br&gt;&lt;input type='text' name='myInputs[]'&gt;";
            document.getElementById(divName).appendChild(newdiv);
            counter++;
       }
  }
  &lt;/script&gt;
  &lt;form method="POST"&gt;
       &lt;div id="dynamicInput"&gt;
            Entry 1&lt;br&gt;&lt;input type='text' name='myInputs[]'&gt;
       &lt;/div&gt;
       &lt;input type='button' value='Add another text input' onClick='addInput("dynamicInput")'&gt;
  &lt;/form&gt;
  </code></pre>