Closed vgarvardt closed 11 years ago
Ajax response with application/json content type opens a file save dialog in some old IEs. So I switched to text/plan and reinforce json data type on client manually.
Maybe text/javascript
better? IE understood that.
Does text/javascript
works better with jquery or some other lib? Is there a point?
What about setting for legacy browsers? Old IEs are rare for now, so legacy compatibility will be used very seldom. Something like:
content_type = '%s; charset=utf-8' % 'text/plain' if getattr(settings, 'HANDY_LEGACY_AJAX_CT', False) else 'application/json'
I am unwilling to add new settings. Is this really useful?
Why there is text/plain content type for decorators.render_to_json? JSON response should have application/json type to determine automatically on client side (e.g. with jQuery.ajax)