How do I change dynamic page title while .load()
<p>How to change my page title <code>&lt;title&gt;&lt;/title&gt;</code> after content is loaded in <code>#container</code> div?</p>

<pre><code>$(document).ready(function () {
    $("a.view").live('click', function () {
        var id = $(this).data("id");
        $('#container').load("view.php?" + id);
    });
});
</code></pre>

<p>If without <code>.load()</code> I retrieve it by get the <code>id</code> via URL, example <code>view.php?id=1</code></p>

<pre><code>if (isset($_GET['id'])) {
 $pageid = intval($_GET['id']);
 $select = $db-&gt;query('SELECT id, title FROM content WHERE id="'.$id.'"');
 $data   = $db-&gt;fetch($select);
 $title  = $data['title'];
}
</code></pre>

<p>So in my <code>header.php</code> just call it <code>&lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt;</code></p>

<p>If in this case file is load after <code>header.php</code> so how can I create dynamic my page title according to current <code>.load("view.php?" + id)</code>?</p>
