receiving and alert with [object Object] when it should be alert the JSON data.
jquery code:
- $.ajax({
- url: "validate_livestock_form/index/",
- type: 'POST',
- dataType: "json",
- data: form_data,
- success: function(data) {
- alert(data);
- }
- });
php page is echoing out:
{"species":"Please select a species!"}
I double checked the response from the php and firebug shows the same.
On success alert is not alerting the JSON data instead,
I'm receiving [object Object].
Why is that and how do what should I do to fix this?
-Thanks,
Rich