私は古典的なaspでいくつかのtwitter認証を行っています(私は知っていますが、私はそれを変更できません)。私がやっていることは、すべてのrest/oauth認証をハンドリングし、必要なoauthキーを使って同じページに戻るwindow.openを使って、jQuery/JSを使ってポップアップで認証ページを開くことです。私はポップアップを閉じて、ページを更新せずにjQueryのhide/showイベントを消したいと思っています。私は、我々は戻ってリダイレクトされたときのために、いくつかのASPに入れ子に同じページに次のコードを持っている親ページ上の子ポップアップ火災のjQueryコードを閉じる
jQuery(document).ready(function() {
jQuery("#twitter-button").live("click", function() {
jQuery("#twitter-button").attr("value", "Processing");
jQuery("#twitter-button").removeClass();
jQuery("#twitter-button").addClass("twitter-button-processing");
window.open('authentication.asp','_blank','width=600,height=400');
return false;
});
});
:fireoffポップアップと認証スクリプトに
コード
if Session("OAUTH_TOKEN") <> "" And Session("OAUTH_TOKEN_SECRET") <> "" Then
%>
<script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
window.close();
// I'd like to show/hide new buttons on the parent page here
});
</script>
<%
End If
目標twitter-button-processingのクラスでボタンを変更することですが、親ウィンドウで変更することはできません。 jQuery( '。twitter-button-processing')を配置しようとしました。 jQuery(window).unload()関数では閉じた後、正しい結果が得られませんでした。
私はBinding jQuery event on a child windowとHow to run function of parent window when child window closes?のソリューションを無駄にしました。どんな助けも素晴らしいだろう。
は、別のウィンドウを使用していないクリーナーで、フォームにajaxで送信するダイアログを使用するだけです – charlietfl