title: SyntaxError: JSON Parse error: Unexpected identifier "object"
body: <p>Please help me to understand what's wrong.
  I want to parse JSON reply as object.</p>
  
  <p>PHP process.php code:</p>
  
  <pre><code>&lt;?php
      $return = array();
          array_push($return['amount']="$amount");
          array_push($return['fee']="$fee");
          array_push($return['total']="$total");
      echo json_encode($return);
  ?&gt;
  </code></pre>
  
  <p>Returns JSON string:</p>
  
  <pre><code>{"amount":"350","fee":"0","total":"350"}
  </code></pre>
  
  <p>JS (jquery) code:</p>
  
  <pre><code>$.getJSON("process.php?amount="+amount, function(data,status) {
     var obj = $.parseJSON(data);
     alert (obj.amount);
  });
  </code></pre>
  
  <p>I receive error:</p>
  
  <blockquote>
    <p>SyntaxError: JSON Parse error: Unexpected identifier "object"</p>
  </blockquote>
  
  <p>BUT! When I try to insert result instead data (but insert ' quotes left/right):</p>
  
  <pre><code>var obj = $.parseJSON('{"amount":"350","fee":"0","total":"350"}');
  </code></pre>
  
  <p>And I see alert = 350. So, it's working good.</p>
  
  <p>I try to make something like that:</p>
  
  <pre><code>var jsonreply = "'"+data+"'";
  var obj = $.parseJSON(jsonreply);
  </code></pre>
  
  <p>But received below error:</p>
  
  <blockquote>
    <p>SyntaxError: JSON Parse error: Single quotes (') are not allowed in
    JSON</p>
  </blockquote>