php - How to return only JSON string for ajax requests [disable view] -
I'm new to Codeigniter. I'm trying to integrate the integer to the coligniter. So when I request Ajax the server should return only the JSON string, but the server instead lets [default] view with JSON string. Is it possible to disable this view and only return data in the codeinator I have used the Zend Framework before I can disable the view for AJAX requests
I like some suggestions like
At the end of the function, in your controller, try:
$ this -> Output-> Set_header ('content-type: app / jason; charset = UTF-8'); $ This- & gt; Output-> Set_output (json_encode ($ array));
Comments
Post a Comment