0

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

7
  • Add type="text/javascript" to the <script> tags to make it valid XHTML 1.0 strict for a start. Commented Apr 22, 2010 at 2:06
  • Thanks - added, but it doesn't seem to change the errors that I get. Commented Apr 22, 2010 at 2:12
  • I just tested the above i dont get any errors...check the encoding of your html file, make sure is utf-8 Commented Apr 22, 2010 at 2:19
  • I tested as well, and nothing came up. Perhaps your version of Fx might help. What version of Firefox are you using? Commented Apr 22, 2010 at 2:19
  • 2
    Is the site served as text/html or application/xml+xhtml? Commented Apr 22, 2010 at 2:21

1 Answer 1

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.)

Sign up to request clarification or add additional context in comments.

1 Comment

Yet another case of "Sending XHTML as text/html Considered Harmful" < hixie.ch/advocacy/xhtml > ? -_-

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.