how to receive in an array on a ajax call |
[eluser]John Madrigal[/eluser]
I'm not quite sure what your asking... If your asking how to receive a full array of data using ajax, I would usually use json to get back an array of objects to display. If you give more information I might be able to help.
[eluser]Unknown[/eluser]
Hi! hope you will be fine in your best spirit. yes you correctly understand me i am sending parameters through javascript by making url like that url='<?php echo base_url()?>admin/timetable/saveTimetableData/'+<?php echo $tid;?>+'/'+pNo+'/'+class+'/'+section+'/'+subject+'/'+Mon+'/'+tue+'/'+wed+'/'+thu+'/'+fri; $.getJSON(url,function(result){ // here i want to get an array(result) to manipulate further logic } NOW HERE IS MY SERVER SIDE CODE $jsonDays=array(); $data=array( 'Mon'=>1, 'Tue'=>1, 'Wed'=>0 ); echo $jsonDays.'('.json_encode($data).')'; Now problem is that i am still not able to get my array into result parameter of callback please help how to get data array into result variable of callback
[eluser]pickupman[/eluser]
This probably should be: Code: $jsonDays = array();
[eluser]nelson.wells[/eluser]
I wrote a blog post about using jQuery ajax and json if you are interested. I think it may help with what you are trying to do. |
Welcome Guest, Not a member yet? Register Sign In |