脚本元素不包含文件,在 FIrebug 中为空

Script Elements Not Including Files and Empty in FIrebug

本文关键字:FIrebug 元素 包含 文件 脚本      更新时间:2023-09-26

我的一些网站很好,但其他网站我从头开始创建,如下所示:

<?php
define("NAME", "Terrasoft");
?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?=NAME?></title>
</head>
<script href="http://yourjavascript.com/8953781221/date.js" type="text/javascript"></script>
<script href="assets/js/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
(function($) {
    $(function() {
        $("#date").html(Date.parse("today"));
    });
})(jQuery);
</script>
<style type="text/css">
#date {
    font-weight: bold;
}
</style>
<body>
    <div>
        Welcome to the <strong>Terrasoft Development Server</strong>. This page was output at a system time of <strong><?=date("g:i:s A")?></strong> on <strong><?=date("F j<'s'u'p>S</s'u'p>")?></strong>. The current local time is <span id="date"></span>.
    </div>
</body>
</html>

。顶部的script元素不会被包含,Firebug 中也没有内容。我在线 - 这不是问题。我得到jQuery is not defined.有什么想法吗?谢谢。

脚本标记没有 href 属性,请使用 src

<script src="http://yourjavascript.com/8953781221/date.js" type="text/javascript"></script>
<script src="assets/js/jquery-1.10.2.min.js" type="text/javascript"></script>
您应该

知道href属性适用于<a>标签/锚点。

src属性指定外部脚本文件的 URL。

注: 指向编写脚本的确切位置的外部脚本文件。

语法:

<script src="URL">