How to change my page title <title></title> after content is loaded in #container div?
$(document).ready(function () {
$("a.view").live('click', function () {
var id = $(this).data("id");
$('#container').load("view.php?" + id);
});
});
If without .load() I retrieve it by get the id via URL, example view.php?id=1
if (isset($_GET['id'])) {
$pageid = intval($_GET['id']);
$select = $db->query('SELECT id, title FROM content WHERE id="'.$id.'"');
$data = $db->fetch($select);
$title = $data['title'];
}
So in my header.php just call it <title><?php echo $title; ?></title>
If in this case file is load after header.php so how can I create dynamic my page title according to current .load("view.php?" + id)?
You can set the
document.titleproperty: