0

シンプルなモーダルとAjaxを使用しています。Ajax からコンテンツを読み取ろうとすると、Chrome で正常に動作します。Internet Explorer 7 と Firefox 3 に問題があります。

私は何を間違っていますか?

私のコード:

print("code sample");

$(document).ready(function () {
    $('#confirma, #confirmDialog a.confirm').click(function (e) {
        e.preventDefault();

        // Example of calling the confirm function.
        // You must use a callback function to perform the "yes" action
        alert("OK");
        confirm("Hello");
    });
});

function confirm(message) {
    $('#confirm').modal({
        close: false,
        position: ["8%",],
        overlayId: 'confirmModalOverlay',
        containerId: 'confirmModalContainer',
        onShow: function (dialog) {
            dialog.data.find('.message').append(message);
            // If the user clicks "yes"
            dialog.data.find('.yes').click(function () {
                // Close the dialog
                $.modal.close();
                $.get("My.php", function (data) {
                    $('#resp').modal({
                        close: false,
                        position: ["8%",],
                        overlayId: 'confirmRespOverlay',
                        containerId: 'confirmRespContainer',
                        onShow: function (second) {
                            var test = "hello";
                            second.data.find('.info').append(data);
                            second.data.find('.yes').click(function () {
                                alert("Double OK");
                            });
                        }//onShow
                    }); //Resp
                });
            });//Click
        }// Onshow
    });//Modal
} //Confirm

file 内のデータを読み取ることはできますmy.phpが、Internet Explorer 7 および Firefox 3 でモーダル表示するとすべてのコンテンツが非表示になります。Chrome では Ajax データが正しく表示されます。

4

1 に答える 1

0

変えればうまくいくかも

second.data.find('.info').append(data);

second.data.find('.info').append(data).show();
于 2009-01-01T04:44:08.680 に答える