views:

817

answers:

1

I am using the simple modal and AJAX, when I try to read the content from AJAX it works fine in Chrome. There is problem in IE7 and Firefox 3.

What am I doing wrong?

My code:

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

I am able to read the data in my.php, but all the content is hidden when it is showing modal in IE7 & Firefox3. Chrome shows the AJAX data correctly.

A: 

what happens if you change:

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

to:

second.data.find('.info').append(data).show();
Eric Martin