simon
simon

Reputation: 173

Issue with dojo dijit.form.ValidationTextBox

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">
<html xmlns="http://www.w3.org/1999/xhtml">

<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?

Upvotes: 3

Views: 2731

Answers (6)

nsdel
nsdel

Reputation: 2263

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.

Upvotes: 1

Serxipc
Serxipc

Reputation: 6699

There are some similar tickets on the dojo trac page:

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

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

Upvotes: 0

simon
simon

Reputation: 173

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

Upvotes: 2

Brian Gianforcaro
Brian Gianforcaro

Reputation: 27180

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.

Upvotes: 0

Brian Gianforcaro
Brian Gianforcaro

Reputation: 27180

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

Upvotes: 1

John Smithers
John Smithers

Reputation: 1520

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

Upvotes: 0

Related Questions