2012-11-25 42 views
-2

不明白! 真的...爲什麼HTML5驗證程序發現錯誤?

<!DOCTYPE html> 
<html lang="fr"> 
<head> 
    <meta charset="utf-8"> 
    <title>The Storage Age</title> 
    <meta name="description" content="The Storage Age"> 
    <meta name="author" content="The Storage Age"> 
    <link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico"> 
    <link rel="stylesheet" href="./css/main.css" type="text/css" media="screen"> 
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"> 
     var _gaq = _gaq || []; 
     _gaq.push(['_setAccount', 'UA-34969704-2']); 
     _gaq.push(['_trackPageview']); 
     (function() { 
      var ga = document.createElement('script'); ga.type = 'text/javascript'; 
      ga.async = true; 
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
      var s = document.getElementsByTagName('script')[0]; 
      s.parentNode.insertBefore(ga, s); 
      })(); 
    </script> 
</head> 
<body> 
    <header> 
    </header> 
     <div id="h"> 
      <article> 
       <h1>&#9679;&#9679;&#9679; The Storage Age &#9679;&#9679;&#9679;</h1> 
       <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.thestorageage.com&amp;doctype=HTML5"><img src="./img/tsa_icon.png" alt="... See you in 2015 AD ..."></a> 
       <h2>Electronic archives rock solid</h2> 
      </article> 
      </div> 
    <footer> 
    </footer> 
    </body> 

驗證器告訴「第21行第11列:元素腳本的文本內容是不是在要求的格式:預計空格,製表符,換行符,或斜線卻發現v改爲「。

+0

**你看了錯誤?** – SLaks

+0

是,並沒有理解... –

+0

他們怎麼說?你不明白什麼?爲什麼不? – SLaks

回答

2

腳本標記要麼使用內聯代碼,要麼使用src代碼,而不是同時使用兩者。

更換

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"> 
     var _gaq = _gaq || []; 
     _gaq.push(['_setAccount', 'UA-34969704-2']); 
     _gaq.push(['_trackPageview']); 
     (function() { 
      var ga = document.createElement('script'); ga.type = 'text/javascript'; 
      ga.async = true; 
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
      var s = document.getElementsByTagName('script')[0]; 
      s.parentNode.insertBefore(ga, s); 
      })(); 
    </script> 

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> 
<script type="text/javascript"> 
     var _gaq = _gaq || []; 
     _gaq.push(['_setAccount', 'UA-34969704-2']); 
     _gaq.push(['_trackPageview']); 
     (function() { 
      var ga = document.createElement('script'); ga.type = 'text/javascript'; 
      ga.async = true; 
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
      var s = document.getElementsByTagName('script')[0]; 
      s.parentNode.insertBefore(ga, s); 
      })(); 

+0

好吧,超級,非常感謝! –

0

A <script>標記可以是外部標記(src="")或內部標記(標記內部的代碼)。
它不能同時存在。