Created
November 1, 2011 12:59
-
-
Save glassesfactory/1330452 to your computer and use it in GitHub Desktop.
twitter OAuth 認証を別窓で処理する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> | |
<head> | |
<title></title> | |
<meta name="google" value="notranslate"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript"> | |
if(!window.opener || window.opener.closed){ | |
} | |
else{ | |
//親ウィンドウの、認証完了時の処理を呼ぶ | |
window.opener.dispatchAuthComplete(); | |
window.close(); | |
} | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> | |
<head> | |
<title></title> | |
<meta name="google" value="notranslate"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript" src="common/swf/swfobject.js"></script> | |
<script type="text/javascript"> | |
/* | |
swfobject 的な処理 | |
*/ | |
var swfID = ''; | |
setSwfName = function(id){ | |
swfID = id; | |
} | |
//認証が完了して、コールバックを受け取った時子窓から呼ばれる | |
dispatchAuthComplete = function(){ | |
//swf の addCallBack で追加したメソッドを呼ぶ | |
swfName(swfID).callback(); | |
} | |
//IE対策 | |
swfName = function(str){ | |
if (navigator.appName.indexOf("Microsoft") != -1){ | |
return window[str]; | |
} | |
else{ | |
return document[str]; | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<div id="flashContent"> | |
<!-- swf 貼付け --> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment