Issue with dojo dijit.form.ValidationTextBox

3

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?

javascript
dojo
asked on Stack Overflow Sep 7, 2008 by simon • edited Jun 25, 2017 by ɢʀᴜɴᴛ

6 Answers

2

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
answered on Stack Overflow Sep 8, 2008 by simon • edited Sep 8, 2008 by simon
1

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

answered on Stack Overflow Sep 7, 2008 by Brian Gianforcaro
1

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.

answered on Stack Overflow Nov 26, 2008 by nsdel
0

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

answered on Stack Overflow Sep 7, 2008 by John Smithers
0

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.

answered on Stack Overflow Sep 7, 2008 by Brian Gianforcaro
0

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.

answered on Stack Overflow Nov 14, 2008 by Serxipc

User contributions licensed under CC BY-SA 3.0