“Resource interpreted as Script but transferred with MIME type text/html” warning

I get this warning when executing a JSONP type request, and I see it in Chrome console.
Resource interpreted as Script but transferred with MIME type text/html

Quick fix for the application that I am building now, (with ZF). Put this line just before you echo the JSONP string.
$this->getResponse()->setHeader('Content-type', 'text/javascript');


About this entry