[jQuery] Re: jQuery, ajax, json, php

2009-06-12 Thread David .Wu
Actually I want need server side doing work, and I don't know how php get json, nothing to do with client side. On 6月12日, 下午4時55分, Anish wrote: > What you get while trying $json['name'] ?? > > Why don't you try getJSON instead of calling usual ajax call ?? > > Regards, > > Anish** > > On Jun 11,

[jQuery] Re: jQuery, ajax, json, php

2009-06-12 Thread Anish
What you get while trying $json['name'] ?? Why don't you try getJSON instead of calling usual ajax call ?? Regards, Anish** On Jun 11, 4:40 pm, "David .Wu" wrote: > If I send a json format to php, how to get the value from php? for > example > > front page > > var jsonStr = '{"name": "David"

[jQuery] Re: jQuery, ajax, json, php

2009-06-11 Thread David .Wu
it's work, cool. On 6月11日, 下午11時58分, Tomáš Kavalek wrote: > Maybe you should use json_decode($json, true); in case of you have a > problem with json_decode($json); > > On 11 čvn, 14:17, Chris Chen wrote: > > > $json = $_POST['json']; > > $user = json_decode($json); > > echo $user['name']; > > >

[jQuery] Re: jQuery, ajax, json, php

2009-06-11 Thread Tomáš Kavalek
Maybe you should use json_decode($json, true); in case of you have a problem with json_decode($json); On 11 čvn, 14:17, Chris Chen wrote: > $json = $_POST['json']; > $user = json_decode($json); > echo $user['name']; > > 2009/6/11 Val Cartei > > > > > > > > > with data.name (data is the json obj

[jQuery] Re: jQuery, ajax, json, php

2009-06-11 Thread Donny Kurnia
David .Wu wrote: If I send a json format to php, how to get the value from php? for example front page var jsonStr = '{"name": "David", "age", "23"}'; $.ajax({ url: 'json.php', type: 'POST', cache: false, data: {json: jsonStr}, success: function(data) {

[jQuery] Re: jQuery, ajax, json, php

2009-06-11 Thread Chris Chen
$json = $_POST['json']; $user = json_decode($json); echo $user['name']; 2009/6/11 Val Cartei > > with data.name (data is the json object you pass to your success > function). Like: > > success: function(data) { >alert(data.name); >} > > Val > > On Thu, Jun 11, 2009 at 12:

[jQuery] Re: jQuery, ajax, json, php

2009-06-11 Thread Val Cartei
with data.name (data is the json object you pass to your success function). Like: success: function(data) { alert(data.name); } Val On Thu, Jun 11, 2009 at 12:40 PM, David .Wu wrote: > > If I send a json format to php, how to get the value from php? for > example > > fro