The response will have content type “text/javascript” and will look like the following:
foo({...});
Another example, showing how to serve either JSON or JSONP from the same action, according to the presence of
a “callback” parameter in the query string:
JSONP helper.
Example of use, provided the following route definition:
The following action definition:
And the following request:
The response will have content type “text/javascript” and will look like the following:
Another example, showing how to serve either JSON or JSONP from the same action, according to the presence of a “callback” parameter in the query string: