Why does my simple strict XHTML file give errors when I include jquery?

99封情书 提交于 2019-12-02 21:08:53

问题


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 :(


回答1:


Is the site served as text/html or application/xml+xhtml?

(It was supposed to be a question, but apparently it was the answer.)



来源:https://stackoverflow.com/questions/2687777/why-does-my-simple-strict-xhtml-file-give-errors-when-i-include-jquery

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!