0

我正在使用简单的 modal 和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

我能够读取文件中的数据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 回答