当我包含jquery时,为什么我的简单严格的XHTML文件会出错? [英] Why does my simple strict XHTML file give errors when I include jquery?
本文介绍了当我包含jquery时,为什么我的简单严格的XHTML文件会出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图制作一个包含jquery的简单严格的HTML文件:
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>
但是,当我尝试加载时,Firefox在错误控制台中显示以下错误:
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
帮助!我不明白:($ / b>
Help! I don't understand :(
推荐答案
网站是以text / html还是application / xml + xhtml?
Is the site served as text/html or application/xml+xhtml?
(这应该是个问题,但显然这是答案。)
(It was supposed to be a question, but apparently it was the answer.)
这篇关于当我包含jquery时,为什么我的简单严格的XHTML文件会出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文