[jQuery] Re: jQuery.get does not return proper JSON

2009-10-26 Thread Maarten
On 22 okt, 00:37, James wrote: > try this: > > $data = array('votes_for'=>7, 'votes_against'=>4); > echo json_encode($data); > exit; Hi James, Thanks for your response but I managed to solve my problem in a different way. I said in my first post the view doesn't always know on forehand what fo

[jQuery] Re: jQuery.get does not return proper JSON

2009-10-21 Thread James
try this: $data = array('votes_for'=>7, 'votes_against'=>4); echo json_encode($data); exit; On Oct 19, 5:31 am, Maarten wrote: > Hi, > > I am using jQuery.get to make an AJAX request to the server which > should return a JSON object, but it is interpretated by jQuery as a > string, not an objec