我正在开发一个包含许多运行超时和间隔的ajax web应用程序.现在我需要清除所有正在运行的超时和间隔.是否有一种简单的方法来阻止所有内容而无需存储每个超时和间隔ID并迭代它们并清除它们?
我FB.login()在我的应用程序中调用了一个click事件.该对话框按预期弹出,但当用户登录Facebook(和/或授权应用程序)时,对话框不会关闭.相反,它加载一个白页(在对话框内),标题更改为XD代理.
这只发生在Google Chrome上(我现在使用的是适用于Windows 7的最新版本).
如果Chrome处于隐身模式,则不会发生这种情况.
fb-login"社交插件"在Chrome上运行良好.
为了进一步测试/调试,我创建了一个带有vanilla设置的新Facebook应用程序.我所做的唯一更改是在应用设置中设置网站网址.这是您可以用来重新创建此错误的HTML代码.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chrome Bug Test</title>
</head>
<body>
<button onclick="dologin()">Login using Facebook</button>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId : '[YOUR APP ID HERE]',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
</script>
<script type="text/javascript">
function dologin(){
FB.login(function(r){ …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用javsacript SDK将Facebook Connect集成到我的网站.
代码就像
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '**********', status: true, cookie: true, xfbml: true});
/* All the events registered */
FB.Event.subscribe('auth.login', function(response) {
// do something with response
login();
});
FB.Event.subscribe('auth.logout', function(response) {
// do something with response
logout();
});
FB.getLoginStatus(function(response) {
if (response.session) {
// logged in and connected user, someone you know
login();
}
});
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}()); …Run Code Online (Sandbox Code Playgroud)