#2332 closed defect (fixed)
Problem creating widgets when Web page is tagged as application/xhtml+xml
Reported by: | Owned by: | bill | |
---|---|---|---|
Priority: | high | Milestone: | 1.6.1 |
Component: | Dijit | Version: | 0.4.1 |
Keywords: | widget parse xhtml | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
dojo gets confused when the mime type of the HTML is application/xhtml+xml.
When I have, say, a button in my Web page of type application/xhtml+xml, when dojo tries to transform the button into a fancy css-based one, I get the following errors:
Mac OS X (10.4) Firefox 2.0.0.1-- DEBUG: dojo.widget.Parse: error: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)"
Mac OS X (10.4) Safari 2.0.4-- FATAL exception raised: Cannot set do-nothing method on that object onscroll FATAL exception raised: Cannot set do-nothing method on that object onresize
Switching the Web page type to text/html fixes the problem in either browser!
HTML source dump appears below.
Chris DiGiano?
<html xmlns="http://www.w3.org/1999/xhtml"><head> <script type="text/javascript">
djConfig = {isDebug: "true"};
</script> <script type="text/javascript" src="/piki/_js/dojo/dojo.js"/><script type="text/javascript">
dojo.require("dojo.event.*"); dojo.require("dojo.widget.*"); dojo.require("dojo.widget.Button");
function helloPressed() {
alert('You pressed the button');
}
function init() {
var helloButton = dojo.widget.byId('helloButton'); dojo.event.connect(helloButton, 'onClick', 'helloPressed')
}
dojo.addOnLoad(init);
</script> </head> <body> <button dojoType="Button" widgetId="helloButton">Hello World!</button> </body> </html>
Attachments (1)
Change History (16)
comment:1 Changed 14 years ago by
Milestone: | → 0.9 |
---|
comment:2 Changed 14 years ago by
Component: | Widgets → Dijit |
---|---|
Milestone: | 0.9 → 1.0 |
comment:3 follow-up: 4 Changed 13 years ago by
Milestone: | 1.0 → 1.1 |
---|
comment:4 Changed 13 years ago by
comment:5 Changed 13 years ago by
I concur with the previous writer. I'm using MathML in Firefox 2.0, and for that I'd also need the MIME type application/xhtml+xml. Christoph
My project: A semantic wiki for mathematics (based on IkeWiki)
comment:6 follow-up: 8 Changed 13 years ago by
Hi Chris. Please attach a testcase using the "attach file" button. Something that runs against 1.0. Can I access the file via file:// protocol, or do I have to load it over http? What settings do I need in apache to make the mime type be application/xhtml+xml ?
comment:7 Changed 13 years ago by
Milestone: | 1.1 → 2.0 |
---|
comment:8 Changed 13 years ago by
Replying to bill:
Hi Chris. Please attach a testcase using the "attach file" button. Something that runs against 1.0. Can I access the file via file:// protocol, or do I have to load it over http? What settings do I need in apache to make the mime type be application/xhtml+xml ?
Maybe I can help here. Either you do some server-side scripting and set the Content-Type HTTP header to "application/xhtml+xml", or, on the client, using Firefox, you name your file *.xhtml or *.xml, but not *.html.
comment:10 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.3 → future |
Well, I think the problems extend beyond the parser. I tried test_Button.html, converted to XHTML (I'll attach the example), and the plain button widgets instantiated correctly but there were errors instantiating the other widgets.
Unfortunately I'm not going to have time to work on this in the forseeable future.
Changed 12 years ago by
Attachment: | test_Button.xhtml added |
---|
XHTML test case (put in dijit/tests/form directory)
comment:11 Changed 10 years ago by
I have the same problem on Chrome and FireFox?. The problems seems to be that some string containing non-XML HTML is assigned to a .innerHTML attribute. For example:
Error: malformed Source file: Line: 6, Column: 41 Source Code:
dojoAttachPoint="_menuBtn" showLabel=false>▼</div>
As you can see the showLabel value false lacks proper quotes to be valid XML.
comment:12 Changed 10 years ago by
Problems like missing quotes were fixed in #11571, looks like this is a new occurence that slipped in. I'll fix the showLabel attribute, not sure if that's sufficient to fix your problem though.
comment:13 Changed 10 years ago by
Milestone: | future → 1.6.1 |
---|
I'll check in that one fix, let me know if it solves the problem for you. I used a regex to search all of our templates and didn't see any other missing quotes, but I might have missed something, or also (as I said above) fixing missing quotes may not be sufficient to solve the problem.
comment:14 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to bill: Any chance of getting this into 1.0? For already existing pages, they sometimes just don't work in HTML - eg if they use XSLT transforms or embedded SVG or the like.