[eluser]Unknown[/eluser]
I have the following view
Code:
<?php
$this->output
->set_content_type('application/json')
->set_output(json_encode(array('foo' => 'bar')));
?>
When I access the controller that points to the view, I get my json object.
However, when I run this javascript on the page, I get ResponseText = "", status = 0, textStatus = "error" in the jqXHR object.
Code:
$.ajax('http://localhost/bh/index.php/ajax/test',
{
data: {'input' : 'hi'},
type:'post',
complete: function (data){
debugger;
}
})();
I'm not sure if there's a problem with jQuery or CI.
Here's the raw response that Fiddler is catching:
Code:
HTTP/1.1 200 OK
Date: Sat, 10 Mar 2012 02:55:11 GMT
Server: Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o
X-Powered-By: PHP/5.3.5 ZendServer
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json
d
{"foo":"bar"}
0
Thanks for the help.