Welcome Guest, Not a member yet? Register   Sign In
Ajax post method not working
#4

[eluser]LuckyFella73[/eluser]
Not sure if you just cropped your code - I can't see the part
where you render the output ($output)

You need something like:
Code:
// more code here

$output = '{ "message": "'.$message.'", "bg_color": "'.$bg_color.'" }';
die($output);

To reduce errors it's better to use the json_encode function by the way.

Code:
$response_data = array(
   'message' => $message,
   'bg_color' => $bg_color
  );
  $json_response = json_encode($response_data);
  die($json_response);


Messages In This Thread
Ajax post method not working - by El Forum - 06-16-2012, 06:09 AM
Ajax post method not working - by El Forum - 06-16-2012, 08:26 AM
Ajax post method not working - by El Forum - 06-16-2012, 09:54 AM
Ajax post method not working - by El Forum - 06-16-2012, 10:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB