设置:
有一个正常工作的 facebook 应用程序,并且正确设置了 facebook 积分交易(即服务器端的一切工作正常)。
在 Firefox 和 chrome 中,交易完成没有问题,但是在 IE8 中,完成/关闭购买对话框时的回调会引发以下错误:
错误一:
Line: 52 Error: Object doesn't support this property or method
Object doesn't support this property or method JScript - script block, line 52 character 37
它指向的功能是:
ui: function( params )
{
obj = FB.JSON.parse( params );
method = obj.method;
cb = function( response ) { FBAS.getSwf().uiResponse( FB.JSON.stringify( response ), method ); }
FB.ui( obj, cb );
},
特别强调这一点:
FBAS.getSwf().uiResponse( FB.JSON.stringify( response ), method )
在http://connect.facebook.net/en_US/all.js文件中
错误 2:
行:65 错误:对象不支持此操作
对象不支持此操作 all.js,第 65 行字符 2198
[它指向的行是一个愚蠢的长无格式不可读的混乱,所以除非要求,否则我将省略它]
特别强调这一点:
delete d._old_visibility
再次在http://connect.facebook.net/en_US/all.js文件中
我正在使用的html(删除了应用程序识别的东西)如下:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Expires" content ="0" />
<meta http-equiv="Pragma" content ="no-cache" />
<meta http-equiv="Cache-Control" content ="no-cache" />
<title>[ APP NAME ]</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">
$(document).ready
(
function()
{
var appId = [ APP ID ];
var host = [ APP HOST ];
// If the user did not grant the app authorization go ahead and
// tell them that. Stop code execution.
if (0 <= window.location.href.indexOf ("error_reason"))
{
$(document.body).append ("<p>Authorization denied!</p>");
return;
}
// Loads the Facebook SDK script.
(function(d)
{
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
// When the Facebook SDK script has finished loading init the
// SDK and then get the login status of the user. The status is
// reported in the handler.
window.fbAsyncInit = function()
{
//debugger;
FB.init(
{
appId : appId,
status : true,
cookie : true,
oauth : true,
});
FB.getLoginStatus (onCheckLoginStatus);
};
// Handles the response from getting the user's login status.
// If the user is logged in and the app is authorized go ahead
// and start running the application. If they are not logged in
// then redirect to the auth dialog.
function onCheckLoginStatus (response)
{
if (response.status != "connected")
{
top.location.href = "https://www.facebook.com/dialog/oauth?client_id=" + appId + "&redirect_uri=" + encodeURIComponent (host+"[ RELATIVE APP PATH ]") + "&scope=publish_stream,user_about_me,read_friendlists,user_photos";
}
else
{
// Start the application
loadGame();
}
}
}
);
function loadGame()
{
var flashvars = {};
var params = {};
var attributes = {};
params.allowscriptaccess = "always";
attributes.id = 'flashContent';
attributes.name = 'flashContent';
swfobject.embedSWF("[ APP SWF ]?"+Math.floor(Math.random()*10000), "flashContent", "100%", "99%", "10.0", null, flashvars, params, attributes);
}
</script>
<div id="flashContent" >
Loading...
</div>
</body>
这只是 IE 8 的一个问题,但由于大量用户事务将失败(或者更确切地说,由于回调失败而将完成、收费并且不生效),因此导致应用程序停止运行。
在过去的几天里,我一直在寻找其他有此或类似问题的人,但无济于事。
我已经看到一些类似的问题,人们被警告关于全局创建的 javascript 变量并导致干扰或变量是使用 IE 中保留的关键字的名称,但据我所知,这里都不是这种情况。facebook javascript 代码是从 facebook 开发页面和可靠来源中提取的相当样板的东西。它可能是 JQuery(我对此几乎没有经验),但是,这又是从工作示例中提取的,如果有问题我看不到它。
任何人都可以帮忙吗?