Parsing JSON encoded PHP array with Javascript - unexpected character : <p>I'm using PHP to encode array to JSON string like this:</p>

<pre><code>$price['price'] = "20";
$price = json_encode($price)
return $price;
</code></pre>

<p>so when I'm accessing the script I get this data:</p>

<pre><code>{"price":"20"}
</code></pre>

<p>Here is my jQuery/Javascript code:</p>

<pre><code>$("#form_pickupDate_day").change(function()
    {
        var frm = $(document.form);
        var data = JSON.stringify(frm.serializeArray());

        $.ajax
        ({
            method: "POST",
            url: "script.php",
            data: {json : data },
            dataType: 'json',
            cache: false,
            success: function(json)
            {
                var obj = JSON.parse(json);
                    $("#form_price").val(obj.price);
            }
        });
    });
</code></pre>

<p>The error I get in Firefox:</p>

<pre><code>SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
</code></pre>
