为什么我的简单严格 XHTML 文件在包含 jquery 时会出错?
我正在尝试制作一个包含 jquery 的简单严格的 HTML 文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Test File</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
</head>
<body>
</body>
</html>
但是当我尝试加载它时,Firefox 在错误控制台中显示以下错误:
Error: d.style is undefined
Source File: http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js
Line: 33
Error: jQuery is not defined
Source File: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js
Line: 19
救命!我不明白 :(
I'm trying to make a simple strict HTML file that includes jquery:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Test File</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
</head>
<body>
</body>
</html>
But Firefox displays the following errors in the error console when I try to load it:
Error: d.style is undefined
Source File: http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js
Line: 33
Error: jQuery is not defined
Source File: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js
Line: 19
Help! I don't understand :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(这本来是一个问题,但显然这是答案。)
(It was supposed to be a question, but apparently it was the answer.)