我有文档的结构:
<?
include('head.php');
include('header.php');
include('index_content.php');
include('footer.php');
include('form.php');
include('js.php');
?>
当我创建一个新页面时,我使用这个框架并仅更改页面内容。但是为了进行SEO优化,还需要更改标题和元标签。是否可以使用JavaScript根据页面动态更改这些内容?或者最好不要麻烦,像这样写:
<?
include('head.php'); //beginning of the <head> tag
?>
<title>Some title</title>
<meta name="description" content="some description">
<meta name="keywords" content="some keywords">
<?
include('header.php'); - //end of </head> tag
include('index_content.php');
include('footer.php');
include('form.php');
include('js.php');
?>
<meta name="description" content="<?php echo $DESCRIPTION;?>">
- Hemal