jQuery ajax + html() not working

jQuery ajax + html() not working

Hi there,
I got an issue with jQuery html() in all IE browsers.
It works fine in other browsers like Firefox and Safari.

My JS:

$(document).ready(function(){

   defaultForm();

   function defaultForm(){
      $("#curlWrap .curlForm .button").click(function () {
      
         var longURL = $('#curlWrap #longUrl').val();
         
         if(longURL != 'http://'){
         
            $("#curlWrap .msg").empty();
            $("#curlWrap .loading").show();
         
      
            $.ajax({
                  url: "index.php",
                  global: false,
                  type: "POST",
                  data: ({url : longURL}),
                 dataType: "html",
                  success: function(msg){
                     $("#curlWrap .loading").hide();
                     $("#curlWrap").slideUp(function () {
                        
                         $("#curlWrap").html(msg);
                         
                         $("input").click(function () {
                           $(this).focus();
                             $(this).select();
                       });
                       
                       returnToForm();
                       
                     });
         
                     $("#curlWrap").slideDown();
                  }   
                  
               });
           }
           
           return false;   
      });
   }
   
   function returnToForm(){
      $("a.return").click(function () {
         var wrap = '#curlWrap';
          $.ajax({
              url: "index.php",
              global: true,
              type: "GET",
              data: ({f : 'DisplyForm'}),
              dataType: "html",
              success: function(msg){
                    $(wrap).slideUp(function () {
                     alert(msg);
                     $(wrap).html(msg);
                     $(wrap).slideDown();
                     defaultForm();
                  });
              }
             });
   
   
         return false;
        });
   }

   
});


As you can see defaultForm() is the first function that's running.
When someone clicks the button it slides up and replace the content with the data received using ajax.

On this page there is a link, "Go Back" which will take you back to the default form. This is done by the function "returnToForm".

So my main problem is in the returnToForm function:

success: function(msg){
                    $(wrap).slideUp(function () {
                     alert(msg);
                     $(wrap).html(msg);
                     $(wrap).slideDown();
                     defaultForm();
                  });


I added the alert function to see if it gets the data using ajax.
And that works fine, i get an alert with the returned html.
Now when i try to replace my wrap with the data returned it just show blank.

Anyone know what this could be?

Thanks & Kind Regards,

Headshot