Hi,
In JQuery ajax Get i am using like the following,
var htm = $.ajax({
type: "GET",
url: "http://localhost/cake_1.2.1.8004/index.php/forms/getFormEntry",
async: false
}).responseText;
alert(htm);
var myObject = eval('(' + htm + ')');
alert(myObject);
My cakePHp code for geFormEntry is
<?php
$data=array();
?>
<?php foreach ($formid as $r):
array_push($data, array('id' => $r['Form']['id']));
endforeach;
echo json_encode(array("attributes" => $data));
?>
My alert(htm) shows
Array{"attributes":[{"id":"21"},{"id":"20"},{"id":"19"},{"id":"18"},{"id":"17"},{"id":"16"},{"id":"15"},{"id":"14"},{"id":"13"},{"id":"12"},{"id":"11"},{"id":"10"},{"id":"9"},{"id":"8"},{"id":"7"},{"id":"6"},{"id":"5"},{"id":"4"},{"id":"3"},{"id":"2"},{"id":"1"}]}
i want to get the attributes id -21.. For that i have used the myObject but showing the error as missing ) in paranthetical
How to do so.. Please suggest me..