Pregunta

I'm using FBJS to post photo

FB.api('me/photos', 'post', {
      message: 'some message',
      url: 'some url'
     }, function(response){
            if (!response || response.error) {
                /*some error alert*/
            else {
                /*some success*/
            }
     }
 });

Almost, it works fine, but OCCASIONALLY, it shows error alert. I see on Console, it says: Resource interpreted as Script but transferred with MIME type text/html

How to deal with it? I've tried some solutions (such as Content-Type, script type...) but it still does not works in SOME times :(

Please help me.

¿Fue útil?

Solución

Have you tried

headers: [ { "name":"Content-Type", "value":"text/javascript; charset=UTF-8"} ]

If it is only occasional, maybe you're hitting an API call limit and it's returning an error? Check that the data is correct, even if it is getting an error. Use fiddler to get more clear diagnostic results.

Otros consejos

I had that problem and in my case the reason was local - the "Disconnect" Chrome addon, that was blocking requests to facebook, I just forgot that I had it installed.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top