2008-09-08 13 views
9

シンプルモダルのようなアドインやUIのキットのダイアログアドインを使いたいと思います。しかし、どのようにこれらを使用するか、他のものを使用して、結果を戻します。基本的には、モーダルにサーバーとのいくつかのAjaxのやりとりを行い、呼び出しコードの結果を返すことでいくつかのことをやります。ありがとう。JQueryでモーダルダイアログから結果を取得するには

答えて

0

モーダルダイアログはページ上にあるので、必要なドキュメント変数を自由に設定することができます。しかし、私が見たすべてのモーダルダイアログスクリプトには戻り値を使ったデモが含まれていたので、そのページにある可能性が高いです。

(サイトは私のためにブロックされているそれ以外の場合は、私は見てね)

5

ここでは、確認ウィンドウがsimpleModal上でどのように動作するかではありません:

$(document).ready(function() { 
    $('#confirmDialog input:eq(0)').click(function (e) { 
    e.preventDefault(); 

    // example of calling the confirm function 
    // you must use a callback function to perform the "yes" action 
    confirm("Continue to the SimpleModal Project page?", function() { 
     window.location.href = 'http://www.ericmmartin.com/projects/simplemodal/'; 
    }); 
    }); 
}); 

function confirm(message, callback) { 
    $('#confirm').modal({ 
    close: false, 
    overlayId: 'confirmModalOverlay', 
    containerId: 'confirmModalContainer', 
    onShow: function (dialog) { 
     dialog.data.find('.message').append(message); 

     // if the user clicks "yes" 
     dialog.data.find('.yes').click(function() { 
     // call the callback 
     if ($.isFunction(callback)) { 
      callback.apply(); 
     } 
     // close the dialog 
     $.modal.close(); 
     }); 
    } 
    }); 
} 
+0

これは、悲しいことに、もはや動作するように表示されます... –

関連する問題