views:

1548

answers:

7

The following xhtml code is not working:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="/dojotoolkit/dijit/themes/tundra/tundra.css" />
    <link rel="stylesheet" type="text/css" href="/dojotoolkit/dojo/resources/dojo.css" />
    <script type="text/javascript" src="/dojotoolkit/dojo/dojo.js" djConfig="parseOnLoad: true"/>
    <script type="text/javascript">
      dojo.require("dijit.form.ValidationTextBox");
      dojo.require("dojo.parser");
    </script>
  </head>
  <body class="nihilo">
      <input type="text"
             dojoType="dijit.form.ValidationTextBox"
             size="30" />
  </body>
</html>

In FireBug I get the following error message:

[Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: http://localhost:21000/dojotoolkit/dojo/dojo.js :: anonymous :: line 319"  data: no]
http://localhost:21000/dojotoolkit/dojo/dojo.js
Line 319

Any idea what is wrong?

A: 

Well, what is dojo.js doing at line 319?

John Smithers
A: 

Where you import dojo.js:

<script type="text/javascript" src="/dojotoolkit/dojo/dojo.js" djConfig="parseOnLoad: true"/>

It should be:

<script type="text/javascript" src="/dojotoolkit/dojo/dojo.js" djConfig="parseOnLoad:true"></script>

Have fun with dojo, it's can do some cool stuff.

Brian Gianforcaro

Brian Gianforcaro
A: 

Hi Brian Gianforcaro

I applied your change but it did not help.

By the way my test is available under Test

simon
A: 

Are you sure your pointing to the right path in the script tags?

I put it up on the web, check it out.

The left is Dojo parsed input, the right is an regular old input. Link

I'm on OS X, using firefox 3.0.1 I get no errors under firebug.

Brian Gianforcaro
+1  A: 

Hi Brian Gianforcaro

The problem seams to be the ending of the file...

  • If I name the file test2.html everything works.
  • If I name the file test2.xhtml I get the error message.

The diverence between the two seams to be the Content-Type in the response header from apache.

  • For .html it is Content-Type text/html; charset=ISO-8859-1
  • For .xhtml it is Content-Type application/xhtml+xml
simon
A: 

There are some similar tickets on the dojo trac page:

http://trac.dojotoolkit.org/search?q=xhtml+ns_error&amp;noquickjump=1&amp;ticket=on

Probably you are facing a bug and you will need to fill a new ticket.

Serhii
A: 

The problem is that innerHTML is an unofficial property that is not part of the W3C specifications, and thus may or may not work depending upon the browser, especially when the page is being rendered as a XHTML file rather than a HTML file. See here and here.

InsDel