The use of document.write in the menu should be replaced with DOM calls. This is a problem when building XHTML pages on a server that serves the correct xhtml mimetype: application/xhtml+xml
The problem is documented here:
http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite
Menu Bug: XHTML compliance (Replace document.write)
Are you talking about the calls for the menu? I have checked the one site I know has xhtml and it validates, the calls for the menu are
and when I check the site for validation those calls do not show as any error.
Ruth
Code: Select all
<script src="/template/main/milonic_src.js" type="text/javascript"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
if(ns4)_d.write("<scr"+"ipt language='JavaScript' src='/template/main/mmenuns4.js'><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language='JavaScript' src='/template/main/mmenudom.js'><\/scr"+"ipt>");
//--><!]]>
</script>
<script src="/template/main/xtopmenu.js" type="text/javascript"></script>
Ruth
What? You should really read up on the XHTML spec. The problem with the menu can be demonstrated pretty easily. Add this to the top of your document if you're using PHP and you'll know what I'm talking about (Don't attempt this on M$IE, do it on FF):John wrote:It works (otherwise the menu wouldn't for those of us who write XHTML), it just doesn't validate.
Mentioned, but not 'documented'. Got a better link?
header("Content-Type: application/xhtml+xml; charset=UTF-8");
More Links:
http://www.w3.org/TR/xhtml-media-types/#text-html
http://en.wikipedia.org/wiki/XHTML
http://www.mozilla.org/docs/web-developer/faq.html
Yes, it validates but if it is served as actual XHTML with the _true_ mimetype, it won't render with document.write.Ruth wrote:and when I check the site for validation those calls do not show as any error.
Writing a document with the XHTML doctype is only part of the equation. A true XHTML document is served like an XML document with application/xhtml+xml because it is an XML document. Now if you're writing plain html pages, then it depends on the server (Apache, IIS) configuration as to whether or not it's serving html documents as text/html or application/xhtml+xml. If the server serves the document as application/xhtml+xml, the XML parser will take over on Gecko (Firefox, Mozilla, Seamonkey, Epiphany, Camino, etc), instead of using the tag soup parser. When that happens, document.write will no longer work and neither will innerHTML for that matter and the result is that the milonic menu will not display because it makes use of document.write. document.write for that matter isn't even a DOM method anyway.John wrote:2. I write XHTML, with a valid doctype, and the menu works for me.
That is correct, the menu uses document.write which is not compatible with XHTML
However, I have yet to see any serious benefit of using XHTML and therefore cannot at this point in time see a valid reason for re-writting the menu.
Also, if we do opt for XHTML compliance, this will mean that the menu is no longer classed as cross browser because it will only work with the latest browser versions.
Kind Regards
Milonic Support
However, I have yet to see any serious benefit of using XHTML and therefore cannot at this point in time see a valid reason for re-writting the menu.
Also, if we do opt for XHTML compliance, this will mean that the menu is no longer classed as cross browser because it will only work with the latest browser versions.
Kind Regards
Milonic Support
Regardless of XHTML, document.write() means it is not possible to use Milonic DHTML Menus in conjunction with client-side XSLT with MozillaAndy wrote:That is correct, the menu uses document.write which is not compatible with XHTML
However, I have yet to see any serious benefit of using XHTML and therefore cannot at this point in time see a valid reason for re-writting the menu.
...
http://www.mozilla.org/projects/xslt/faq.html
4. What about document.write?
Just like for XHTML, document.write is not supported during XSLT
transformations.
Do Milonic have a menu version which does not use document.write()?
Why not just update using DOM interface or innerHTML?
It's because it is not cross browser compatible.Why not just update using DOM interface or innerHTML?
This will fail in older browsers. believe it or not, people still want support for Netscape 4 and using this means the menu will break in the browser and also break in older versions of Internet Explorer[/quote]