4

I have a file with JSONP (hard-written callback) and I named it file.jsonp. Unfortunately server treats it as "text/plain" and browser returns warning:

Resource interpreted as Script but transferred with MIME type text/plain.

Calling it file.json causes the same warning. So what is the right extension? It works with file.js, but I don't think it is the right way.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
ciembor
  • 7,189
  • 13
  • 59
  • 100
  • 2
    This means your server doesn't know the content type to specify when it hands out file.jsonp. How and where you specify MIME types varies by web server, but see this question for the answer if you're using Apache (and good info all around): http://stackoverflow.com/questions/3467404/chrome-says-resource-interpreted-as-script-but-transferred-with-mime-type-text – Christopher Nov 21 '11 at 18:01
  • I know, but I'm curious why it doesn't:). I don't know what is a standard naming for jsonp files. – ciembor Nov 21 '11 at 20:12

1 Answers1

4

JSONP is nothing but pure javascript code. So the right extension for it is .js. And the correct mime type is application/javascript.

Joyce Babu
  • 19,602
  • 13
  • 62
  • 97