title: Uncaught SyntaxError: Unexpected token +
body: <p>I am getting this error using this code, the php id variable is set, why does it show unexpected token?</p>
  
  <pre><code>var current_page = 1;
  var id = &lt;?php echo $id; ?&gt;;
  $(document).ready(function(){ 
      $.ajax({
          'url':'get_data.php',
          'type':'post',
          'data': 'p='+current_page, 'id='+id,
          success:function(data){
              var data = $.parseJSON(data);
              $('#posts').html(data.html);
              $('#pagination').html(data.pagination);
          }
          console.log(data);  
      });
  });
  </code></pre>