From 5e7547cd3f6d52797dfc4362447c2871ba976e41 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 5 Dec 2013 09:01:46 +0000 Subject: Latest docs build --- api-guide/renderers.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'api-guide/renderers.html') diff --git a/api-guide/renderers.html b/api-guide/renderers.html index cb723e6a..1441b7ba 100644 --- a/api-guide/renderers.html +++ b/api-guide/renderers.html @@ -311,7 +311,10 @@ def user_count_view(request, format=None):

JSONPRenderer

Renders the request data into JSONP. The JSONP media type provides a mechanism of allowing cross-domain AJAX requests, by wrapping a JSON response in a javascript callback.

The javascript callback function must be set by the client including a callback URL query parameter. For example http://example.com/api/users?callback=jsonpCallback. If the callback function is not explicitly set by the client it will default to 'callback'.

-

Note: If you require cross-domain AJAX requests, you may want to consider using the more modern approach of CORS as an alternative to JSONP. See the CORS documentation for more details.

+
+

Warning: If you require cross-domain AJAX requests, you should almost certainly be using the more modern approach of CORS as an alternative to JSONP. See the CORS documentation for more details.

+

The jsonp approach is essentially a browser hack, and is only appropriate for globally readable API endpoints, where GET requests are unauthenticated and do not require any user permissions.

+

.media_type: application/javascript

.format: '.jsonp'

.charset: utf-8

-- cgit v1.2.3