title: JavaScript error unexpected identifier when trying to do jQuery AJAX call
body: <p>I have this jQuery code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() 
  {
      $('.vote_up').click(function() 
      {        
          alert ( "test: " + $(this).attr("data-problem_id") );
          problem_id = $(this).attr("data-problem_id");
  
          var dataString = 'problem_id='+ problem_id + '&amp;vote=+';
  
          $.ajax({
                  type: "POST",
                  url: "/problems/vote.php",
                  dataType: "json",
                  data: dataString,
                  success: function(json)
                  {           
                      // ? :)
                      alert (json);
  
  
                  }
                  error : function() 
                  {
                      alert("ajax error");
                  }
              });
  
  
          //Return false to prevent page navigation
          return false;
      });
  
      $('.vote_down').click(function() 
      {
          alert("down");
  
          problem_id = $(this).attr("data-problem_id");
  
          var dataString = 'problem_id='+ problem_id + '&amp;vote=-';        
  
          //Return false to prevent page navigation
          return false;
      });    
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I also have this link HTML:</p>
  
  <pre><code>        &lt;p class="half_text"&gt;&lt;?php echo $upvotes; ?&gt; &lt;strong&gt;&lt;a class="vote_up" style="color: #295B7B; font-weight:bold;" href="#" data-problem_id="&lt;?php echo $problem_id; ?&gt;"&gt;Vote Up&lt;/a&gt;&lt;/strong&gt; | &lt;?php echo $downvotes; ?&gt; &lt;strong&gt;&lt;a class="vote_down" style="color: #295B7B; font-weight:bold;" href="#" data-problem_id="&lt;?php echo $problem_id; ?&gt;"&gt;Vote Down&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
  </code></pre>
  
  <p>When I press the link, I get the Javascript console error "Syntax error: unexpected identifier"</p>
  
  <p>You can reproduce this by clicking on a vote-up link here <a href="http://www.problemio.com" rel="nofollow">http://www.problemio.com</a></p>
  
  <p>Any idea why this is happening and how to fix it?</p>