On 8/9/07, Cliff Hirsch <[EMAIL PROTECTED]> wrote: >> My Ajax response handler uses this line, which is fairly typical: >> var output = req.responseText; >>> >From php, I'm echoing back json. Example: {"status":1,"count":0,"data":""} >> But instead of var output being an object, it is a string: >> "{"status":1,"count":0,"data":""}" >> How do I make this an object? >> >> Cliff
As usual, figured it out minutes after my post. Answer for the group: From: var output = req.responseText; To: var output = eval('('+req.responseText+')'); Better answer don¹tr try to reinvent the wheel. Yeah but we can¹t help ourselves. Xajax looks very cool....
_______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php