I have:
Code: Select all
while ($rows = mysql_fetch_array($results))
{
foreach($rows as $key=>$val) $arr[] = "\"$key\":$val";
echo '{'.implode(', ', $arr).'}';
}
What can I do with this on the Javascript side?
Every time I have my request like this:
Code: Select all
$.post(location.href,{action: "select",title: $("li.selected").text()},function (data) {
data = eval('('+data+')');
$("#title").removeAttr("disabled");
$("#imageFile").removeAttr("disabled");
$("#artical").removeAttr("disabled");
$("#submit").removeAttr("disabled");
});
How could I take the response string from PHP and turn it into a JavaScript obj?
Thanks for reading I appreciate some help with this one.