title: jQuery Ajax return html AND json data
body: <p>I'm not sure if there is any way to do this or not, but this would solve so many of my problems if there is a simple solution to this.</p>
  
  <p>What I need/want to be able to do is return HTML and JSON in my success of ajax request. The reason being, I want to request a file and return all of that page, but I also want to be able to return a specified set of information from the page in json, so I can use it for other things.</p>
  
  <p>This is what I'm doing now:</p>
  
  <pre><code>     $.ajax({
      type: "POST",
      url: "inc/"+page+".php",
      data: "id="+encodeURIComponent(pageID),
      success: function(html){
  
          $("body &gt; .container").html(html);
  
        }
        });
  </code></pre>
  
  <p>This is what I'd like to be able to do:</p>
  
  <pre><code>     $.ajax({
      type: "POST",
      url: "inc/"+page+".php",
      data: "id="+encodeURIComponent(pageID),
      success: function(html){
          $("body &gt; .container").html(html);
              $("title").html(json.PageTitle)
        }
        });
  </code></pre>
  
  <p>on the page that is being returned, I would specify what I want the title to be. (For instance, if it's a profile, I would return the user's name)</p>