List Info

Thread: Specifiying content-type for JSON




Specifiying content-type for JSON
country flaguser name
United Kingdom
2007-12-16 16:37:42
I've have a VIEW, which can return either a JSON file or an
html template.

Does anybody know how I can use javascript, so the browser
can determine 
whether the response is either JSON or html text?

I presume that there is something in javascript that can
determine the 
content-type of the response,  but I struggling to find out
what it is.

One final question  - is there any other reason to tell the
browser that 
the response is of "application/json" 
content-type -  does it make the 
browser quicker or something?

Cheers



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )