-2

不明白!真的 ...

<!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”。

4

2 回答 2

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);
            })();

于 2012-11-25T19:08:44.093 回答
0

<script>标记可以是外部的( src="") 或内部的(标记内的代码)。
不能同时两者兼而有之。

于 2012-11-25T19:08:43.763 回答