[請益] <script>跑到<body>裡
我把這段程式碼寫在"header.php"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"" rel="nofollow">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-tw" lang="zh-tw">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tick Tock | <?php echo $page_title; ?></title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="showevent.js"></script>
</head>
<body>
接著我在我需要用的地方使用 require_once('header.php')去呼叫
但神奇的是 <script>、<link> 這兩個標籤
會變成巢在<body>裡頭 變成
<body>
<link .... />
<script>...</script>
想請問先進們 為什麼會發生這種情形呢
P.S. 1.假如我把上段程式碼硬code到網頁上,那上述情況就不會發生
2.<script>或<link>巢進<body>在部分瀏覽器顯示時增加些許 margin
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.127.143.110
→
12/10 01:49, , 1F
12/10 01:49, 1F
※ 編輯: jbluebox 來自: 59.127.143.110 (12/10 01:52)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
0
18