how to make the json data into jquery code?
<p>the php json_encode($object) result is</p>

<pre><code>[{"price_id":"1","website_id":"0","price_qty":2,"price":"90.0000"},
 {"price_id":"2","website_id":"0","price_qty":5,"price":"80.0000"},
 {"price_id":"3","website_id":"0","price_qty":8,"price":"70.0000"}]
</code></pre>

<p>someone tell me, <code>var sorted = arrayWithJsonData.sort(function(a,b){}</code></p>

<p>how to use the above php json_encode($object) to arrayWithJsonData.
i used the following way, but it shows TypeError: object.sort is not a function</p>

<p>first: in php i did: <code>echo '&lt;div style="display:none;" id="object"&gt;'.$object.'&lt;/div&gt;';</code> then using in jquery</p>

<pre><code>var object=jQuery("#object").text(); // first sort the array var sorted = object.sort(function(a,b){}
</code></pre>
