Jquery Ajax and the use of $.toJSON() function
<p>what is the use of $.toJSON() function. it seems that it convert the data in json format.
here is the code snippet</p>

<pre><code>data: $.toJSON({ name: $("input[type=text]").val() })
</code></pre>

<p>without using $.toJSON() function we can supply data manually in josn format like</p>

<pre><code>data: { name: $("input[type=text]").val() }
</code></pre>

<p>it will also work i think. please discuss. thanks</p>
