开发者

How do I show errors returned from the Javascript SDK

开发者 https://www.devze.com 2023-04-06 18:59 出处:网络
I\'m working on a script that combines both the PHP and Javascript SDKs. It\'s a pretty basic script, and for the most part it works, but it\'s going to be used by others and I\'m trying to make it a

I'm working on a script that combines both the PHP and Javascript SDKs.

It's a pretty basic script, and for the most part it works, but it's going to be used by others and I'm trying to make it a bit more bullet-proof.

The issue I have is that if anything like the URL, API Key or Secret are incorrect there is no message shown to the user to help them realise their problem.

If I watch the HTTP stream (with HttpFox) I can see that there is an error being returned. Something like... <span>Given URL is not permitted...</span>

But nothing appears in the display. The span tags, make it seem like this response is intended for display, but I don't know where it should appear, or why it isn't.

Is there some specially named div element that I'm supposed to have on my page?

A开发者_如何学Pythonny help appreciated!


The 'Dialogs API' has an optional 'show_error' parameter that you can add to request URLs to display some additional information about errors. This works when calling dialogs via the Javascript SDK.

But for some other things from the SDK - yeah, sometimes it just says: "there was an error" and doesn't display anything else about it. It's annoying, but more often than not - it's something related to your facebook APP settings (i.e. incorrect app-id, incorrect domain-name, etc.)

0

精彩评论

暂无评论...
验证码 换一张
取 消