title: jQuery .ajax() html response. Find <body>
body: <p>I have a .ajax call which loads a url via a post request, much like .load() would do. I am reading the responseText to get the valid HTML. I would then like to grab the ,  and my own #content id.</p>
  
  <p>The title is used to replace the title of the page. The #content is the content to replace on the page, and I need the body tag for the class attribute, as their are specific classes to each page which I would like to load.</p>
  
  <pre><code>    $.ajax({
      url: url,
      type: 'POST',
      data: {},
      complete: function (result) {
  
          var html = $('&lt;div&gt;' + result.responseText + '&lt;/div&gt;'),
              title = html.filter('title:first').text(),
              b = html.find('body'),
              inner = html.find('#content').html();
  
          console.log(b);
  
          //change document title
          document.title = title;
  
          //add new content
          wrap.html(inner);
  
          //for home page
          $(window).trigger('resize');
  
          //fade in
          wrap.fadeIn(500, function () {
  
              wrap.trigger('newpage');
              $('#wrap').css('min-height', '100%');
  
          });
  
      }
  });
  </code></pre>
  
  <p>Assume that wrap is defined. Please. The issue here is, I cannot retrieve body for the purposes of reading the classes. It always returns undefined. I have also tried using .filter() instead of .find(), but with no luck.</p>
  
  <p>Any ideas?</p>