@Anywhereを使用して、自分のサイト用にカスタマイズした Twitter ログイン ボタンを作成し ました。私の問題は、提供したURLにリダイレクトされて閉じないため、ポップアップウィンドウが自動的に閉じないため、Twitterログインポップアップウィンドウを手動で閉じたいことです。
以下は、私が働いている私のコードです:
twttr.anywhere(function (T) {
var currentUser,
screenName,
profileImage,
profileImageTag;
document.getElementById("tweet").onclick = function () {
T.signIn();
};
T.bind("authComplete", function (e, user) {
window.location.reload();
});
if (T.isConnected()) {
currentUser = T.currentUser;
var add = currentUser.data('name'); //Getting user name from its twitter account
var n = add.split(" ");
document.getElementById('firstName').value = n[0];
alert(document.getElementById('firstName').value);
document.getElementById('LastNm').value = n[1];
//T("#twitter-connect-placeholder").connectButton();
twttr.anywhere.signOut();
} else {
//T("#twitter-connect-placeholder").connectButton();
/* Making the text box value empty*/
document.getElementById('firstName').value = "";
document.getElementById('LastNm').value = "";
/* Making the text box value empty*/
};
});