Welcome Guest, Not a member yet? Register   Sign In
sending json using $this->output-set_output()
#5

[eluser]CodeIgniteMe[/eluser]
I think this is enough on the back-end
(encodes PHP objects and arrays into JSON format)
Code:
echo json_encode($response);

and on the front-end/javascript
(ajax call for the URL and convert the response into JSON object. shorthand for $.ajax)
Code:
$.getJSON(URL, function(data){
alert(data);
});


Messages In This Thread
sending json using $this->output-set_output() - by El Forum - 06-20-2012, 06:14 PM
sending json using $this->output-set_output() - by El Forum - 06-20-2012, 07:53 PM
sending json using $this->output-set_output() - by El Forum - 06-20-2012, 09:04 PM
sending json using $this->output-set_output() - by El Forum - 06-20-2012, 09:15 PM
sending json using $this->output-set_output() - by El Forum - 06-20-2012, 10:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB