WeatherBug Forums

API Forum

RSS Feed

JSONP MIME problem

  1. Hello,

    I'm accessing http://i.wxbug.net/REST/Direct/GetAlert.ashx from javascript using JSONP. I'm getting a "Resource interpreted as Script but transferred with MIME type text/plain." message in the console. Is there a way for me to get this response with a type of "application/x-javascript" or similar?

    thanks

    Message edited by kfnichols 6 months ago

  2. kfnichols1 year ago

    Does anyone have any thoughts on this? Perhaps I'm not thinking clearly or am taking the wrong approach? Any help would be much appreciated.

  3. DonnyV6 months ago

    I'm having the same problem. It looks like WeatherBug is sending back raw json instead of the json wrapped in a javascript function (look at JSONP spec). Which then the browser would execute. The only reason I can see them doing this is so that your forced to use a server side proxy. So you would need to call your server and your server would make the url request, handle the response and then forward it to your client side javascript. By doing this there locking the api key to a server with an IP they can track.

[ Page 1 of 1 ]