Welcome Guest, Not a member yet? Register   Sign In
Ajax newbie - nothing happening
#3

[eluser]nelson.wells[/eluser]
Without looking too much at it, your php function should be echoing the data, not returning it. What I like to do is put data into an associative array, json_encode it, and then 'return' it to the calling js function and output like you are doing in js.

Code:
$data = array(
    'name' => $user->sub_user_name,
    'address' => $user->sub_user_address,
    'email' => $user->sub_user_email,
    'tel' => $user->sub_user_tel
);

$json = json_encode($data);

echo $json;


Messages In This Thread
Ajax newbie - nothing happening - by El Forum - 04-15-2010, 04:29 AM
Ajax newbie - nothing happening - by El Forum - 04-15-2010, 05:21 AM
Ajax newbie - nothing happening - by El Forum - 04-15-2010, 08:13 AM
Ajax newbie - nothing happening - by El Forum - 04-15-2010, 08:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB