webEater wrote:
When use text/html as header for my page the method
element.offsetWIdth/Height work as usually and return the real
width/height of an element, but when I use XML as type (which is
necessary in modern browsers to use strict XHTML) the function returns
just 0.
I don't understand what you are trying to say. offsetWidth and
offsetHeight are properties and not functions. If you want to send XHTML
as application/xhtml+xml (to browsers that support that like Mozilla or
Opera) then offsetWidth and offsetHeight are still properties and not
functions. And in a simple example it is not 0 that is returned but
rather values greater than null
<http://home.arcor.de/martin.honnen/javascript/2006/11/test2006110101.xhtml>
at least here for me with Mozilla and with Opera 9.
But you can send XHTML 1.0 as text/html and have it rendered in
standards compliant mode:
<http://home.arcor.de/martin.honnen/javascript/2006/11/test2006110102.html>
Unless you want to use mixed namespace documents like XHTML with MathML
and/or SVG there is not need to use XHTML. Stick with HTML 4.01 sent as
text/html.
The prototype function
Element.getDimensions() doesn't work in strict mode.
I don't think the author of that stuff reads comp.lang.javascript.
--
Martin Honnen
http://JavaScript.FAQTs.com/