jQuery UI Dialog & XHTML Compliance

Skip to first unread message

Andrew Powell

Oct 19, 2009, 5:29:53 PM10/19/09
to jquery...@googlegroups.com
Hello all,

I'm working from the current trunk version here; I've found an issue
with the dialog and XHTML compliance. ThrushAAX was kind enough to
point out in #jquery-ui that if you don't have the title option set
when working with a page properly served up as application/xhtml+xml
that the dialog will cause an error. The exact error within Firefox is
as follows:

Error: undefined entity
Source File:
Line: 1, Column: 43
Source Code:
<div xmlns="http://www.w3.org/1999/xhtml">&nbsp;</

Error: uncaught exception: [Exception... "Component returned failure
code: 0x80004003 (NS_ERROR_INVALID_POINTER)
[nsIDOMNSHTMLElement.innerHTML]" nsresult: "0x80004003
(NS_ERROR_INVALID_POINTER)" location: "JS frame ::
http://localhost/res/js/jquery/jquery-1.3.2.min.js :: anonymous ::
line 12" data: no]

Line 38 in jquery.ui.dialog.js is the immediate offender. The simple
fix is to replace instances of '&nbsp;' in the script to '&#160;'.
&nbsp; is an invalid xml entity, and &#160; is the code replacement,
and is recognized in all browsers. Ideally, that element shouldn't
have anything inserted, as the user did not specify that he/she wanted
a 'space'. But replacing it with the numeric code is pretty

Please do share your comments. I would like to fix this for the next
version (1.8 if I'm not mistaken).


Scott González

Oct 19, 2009, 7:43:51 PM10/19/09
to jquery...@googlegroups.com
Hey Andrew,

Thanks for pointing this out. Can you create a ticket? I don't see any problems with the fix you're proposing, so you can commit the change yourself (no need to attach a patch to the ticket).

I believe the reason we use a space instead of an empty string is to force the title bar to have some height.

Andrew Powell

Oct 20, 2009, 11:17:23 AM10/20/09
to jquery...@googlegroups.com
No problem. I'll get on that today.

2009/10/19 Scott González <scott.g...@gmail.com>:

Andrew Powell

Nov 21, 2009, 12:02:21 PM11/21/09
to jquery...@googlegroups.com
Took me a while to get around to it, but I've wrapped this up. Created
the bug in trac, committed the source and of course, followed the
commit and trac instructions on the wiki.

>> --~--~---------~--~----~------------~-------~--~----~
>> You received this message because you are subscribed to the Google Groups
>> "jQuery UI Development" group.
>> To post to this group, send email to jquery...@googlegroups.com
>> To unsubscribe from this group, send email to
>> jquery-ui-de...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/jquery-ui-dev?hl=en
>> -~----------~----~----~----~------~----~------~--~---
Reply all
Reply to author
0 new messages