views:

33

answers:

2

Hi,

currently using jq 1.4.2

And i have gone through this forum and other forums for a simple fix ... since so many have had this problem..but i have not found anything that seems to work hence i am posting this problem

        $(".editvolunteer").fancybox({
            'width'                : 970,
            'height'            : 460,
            'autoScale'            : false,
            'transitionIn'        : 'none',
            'transitionOut'        : 'none',
            'type'                : 'iframe',
            onClosed : function() {
              $.ajax({
            type: "GET",
            dataType: 'html',
             cache: false, 
               url: "ajaxrosterupdate.php",
            data: "x=60",
              async: false,

        success: function(data) {        

              $("#updateroster").html(data);      <---- this work in FF            

        }
        success: function(resp, txtS, xhr) {
                           if (xhr.status==200) {      

                              alert(xhr.status);    <-- this alert box shows up in ie and FF

                                 } else {

                             //    alert(xhr.status);

                           }
        }

      }).responseText;



    }
       });

I dont know what i am doing wrong i have used debugbar and i can seethe html content that comes back i have used fiddler and i see the html content that comes back there....the xhr stat =200 so every thing is good..yet it does not replace the the content $("#updateroster").html(data).

I have been banging my head for the last 48 hrs and well i need help.

thanks andy

A: 

You are missing a "comma" after the success property.

alt text

And why would you call success twice in your ajax() method ? It's also very likely that the first success gets overwritten here. Just put one success property in there.

jAndy
i have corrected the "," issue in my code (forgot to post the "," on here) so thats not it. thanks
andy
@andy: see my updated post. It looks like you're calling `success` twice. I strongly recommend to put all your "success" logic into ONE handler. Otherwise it might get overwritten.
jAndy
jandy, can you send me the code ? i am afraid i might get it wrong..
andy
jandy, success: function(data, txtS, xhr) { if (xhr.status==200) { $("#updateroster").html(data.responseText) ; alert(xhr.status); } else { // alert(xhr.status); } }
andy
andy
$("#updateroster").html(data) ; <- this works in ff but in ie it replaces #updateroster with blank space but when i see the debug bar headers and content its all there
andy
@andy: it should look like: http://www.jsfiddle.net/hmQGT/
jAndy
funny i put in a alert(data) and it shows up both in ie and ff
andy
success: function(data, txtS, xhr) { $("#updateroster").html(data); if (xhr.status==200) { alert(data); alert(xhr.status); } else { // alert(xhr.status); } }
andy
i had to add data instead of resp as it was through a error saying data not defined but the moment i added that i got the $("#updateroster").html(data) work in ff but nor ie and alert(data); alert(xhr.status); both worked in IE and FF
andy
A: 

.html() is ultimately using .innerHTML here, what it seems like is your markup coming back is invalid causing some issues.

If there's something wrong with the markup and you're seeing no error but an empty result, chances are one browser is tolerating that invalid HTML, showing it as best it can, and another browser may discard it entirely...which appears to be what IE is doing to you.

Nick Craver