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

Posted by Colen on Stack Overflow See other posts from Stack Overflow or by Colen
Published on 2010-04-22T01:57:12Z Indexed on 2010/04/22 2:03 UTC
Read the original article Hit count: 335

Filed under:
|
|

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 src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script 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 :(

© Stack Overflow or respective owner

Related posts about html

Related posts about strict