我的一些网站很好,但其他网站我从头开始创建,如下所示:
<?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<sup>S</sup>")?></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">