Frage

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.

War es hilfreich?

Lösung

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.

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top