joomla/joomla-cms — pull request #2013 by piotrmocko (2013-09-18 11:00:53+00:00)
Title: Support JSON response in Internet Explorer < 10

Internet Explorer older than 10 does not accept
Content-Type: application/json
and would start to download it.
But this one would work for older IE and all new browsers
Content-Type: text/plain

When you send ajax request by jQuery just set header:
```JavaScript
$.ajax({
url: ...,
dataType: 'json',
headers: {
Accept: 'application/json'
},
accept: 'application/json'
}).done(function(data, textStatus, jqXHR) {
...
});
```

and then server would respond with:
Content-Type: application/json

Also we should use
```php
JResponse::toString();
```
because in ajax method on server side there might be set some other headers by
```php
JResponse::setHeader(...);
```