473,287 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Creating XHTML in an iframe

I am trying to find a way to load XHTML content in an Iframe.

I use to do this in html by using the following code :

var iframeObject = document.createElement("iframe");
MyDiv.appendChild(iframeObject);
var data =
"<html><head><title>testing</title></head><body>data</body></html>"
iframeObject.contentDocument.open();
iframeObject.contentDocument.writeln(data);
iframeObject.contentDocument.close();

This works fine. I can create my content dynamicly and synchroniously.
No problem.

No I try to switch to XHTML, but have trouble getting th eiframe to
understand that it gets XHTML data. It simply assumes that the data is
"text/html".
I tried to add the contentType with the .open() arguments:

var iframeObject = document.createElement("iframe");
MyDiv.appendChild(iframeObject);
var data = "<!DOCTYPE html PUBLIC \"-//W3C//DTD ..etc..
transitional.dtd\">"
+ "<html xmlns=\"http://www.w3.org/1999/xhtml\" > etc etc </html>";
iframeObject.contentDocument.open("application/xhtml+xml", true);
iframeObject.contentDocument.writeln(data);
iframeObject.contentDocument.close();

The code runs but the content is not seen as xhtml, so I can't mix html
and xml. Someone gave me the hint to use the following:

iframeObject.src="data:application/xhtml+xml,"+data;

This works, the data gets loaded and is actually seen as xhtml, but..
the loading happens async in stead of sync.

Is there anyone who can help me with :
- does document.open("application/xhtml+xml", true) work at all?
should it work ?
- are there other ways to wait for an async loading in scripting ?

Kees

Aug 26 '05 #1
16 7021


Mcginkel wrote:

Is there anyone who can help me with :
- does document.open("application/xhtml+xml", true) work at all?
should it work ?
If you really have used script and application/xhtml+xml before then you
probably know that current browsers (at least Mozilla and Opera) do not
support document.write for that content type. And I don't think there is
any intention to support it.
So the problem is not simply the document.open call but the
document.write calls that would follow.
- are there other ways to wait for an async loading in scripting ?


Mozilla allows an onload handler on an iframe element so you could try alike

var div = document.createElement('div');
var iframe = document.createElement('iframe');
div.appendChild(iframe);
document.body.appendChild(div);
iframe.onload = function (evt) {
alert(evt.type + '; target: ' + evt.target + '; currentTarget: ' +
evt.currentTarget);
if (evt && evt.currentTarget && evt.currentTarget.contentDocument) {
var element = evt.currentTarget.contentDocument.documentElement;
alert('nodeName: ' + element.nodeName + '; namespaceURI: ' +
element.namespaceURI);
}
};
iframe.src = 'data:application/xhtml+xml,' + [
'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">',
'<head>',
'<script type="text/javascript">',
'window.onload = function (evt) { alert(\'document: \' + document +
\'; contentType: \' + document.contentType); };',
'<\/script>',
'</head>',
'<body>',
'<h1>test</h1>',
'</body>',
'</html>'
].join('');

Mozilla (tested with 1.7) shows the contentType as application/xhtml+xml
for the document in the iframe and nodeName/namspaceURI are also as they
should be in an XHTML document (lower case nodeName, namespace
http://www.w3.org/1999/xhtml).

Note that for that data: URL the iframe src is set to I have just
followed your example but I would need to check the data URL
specification and check whether the string needs to be URL encoded
before using that stuff in the praxis.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 26 '05 #2
>If you really have used script and application/xhtml+xml before then you
probably know that current browsers (at least Mozilla and Opera) do not
support document.write for that content type. And I don't think there is
any intention to support it.
So the problem is not simply the document.open call but the
document.write calls that would follow.


I know that you cannot use write() while parsing an xhtml document. I
just assume I can write a new document once into another window or
frame. so not modifying the original doc. Is that outside the scope of
the spec ?

Thanks for the example, but it is still an async notification when the
frame is ready loading. In my code I load a library with functions, I
will use the functions directly after the call document.close() or
..src="data:.......". I am stuck with some old code that works fine in
IE and HTML. Now I try to move to XHTML and supporting other browsers.
I hoped to find a way without rewriting the code too much.

As you have worked with XHTML. Is it worth migrating to ? The main
reason to change is the option to mix html with xml (simular to
dataislands in IE) and svg. The opinions on XHTML are quite diverse,
depending on who you speak. Is it solid enough to build appliactions in
a browser ?

Kees

Aug 26 '05 #3
Mcginkel schrieb:
If you really have used script and application/xhtml+xml before then you
probably know that current browsers (at least Mozilla and Opera) do not
support document.write for that content type. And I don't think there is
any intention to support it.
So the problem is not simply the document.open call but the
document.write calls that would follow.

I know that you cannot use write() while parsing an xhtml document. I
just assume I can write a new document once into another window or
frame. so not modifying the original doc. Is that outside the scope of
the spec ?

Thanks for the example, but it is still an async notification when the
frame is ready loading. In my code I load a library with functions, I
will use the functions directly after the call document.close() or
..src="data:.......". I am stuck with some old code that works fine in
IE and HTML. Now I try to move to XHTML and supporting other browsers.
I hoped to find a way without rewriting the code too much.

As you have worked with XHTML. Is it worth migrating to ? The main
reason to change is the option to mix html with xml (simular to
dataislands in IE) and svg. The opinions on XHTML are quite diverse,
depending on who you speak. Is it solid enough to build appliactions in
a browser ?

Kees


Can't answer your questions but one thing to remember on using iframes in XHTML:
There is no iframe anymore in XHTML, so you shouldn't switch to XHTML when you
want to use iframes.
Aug 26 '05 #4


Martin Kurz wrote:

Can't answer your questions but one thing to remember on using iframes in XHTML:
There is no iframe anymore in XHTML, so you shouldn't switch to XHTML when you
want to use iframes.


That is nonsense, XHTML 1.0 is simply a reformulation of HTML 4 so it
has all the elements like <iframe>, <frameset>, <frame> and the target
attribute if you use the proper XHTML 1.0 DTD:
<http://www.w3.org/TR/xhtml1>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 27 '05 #5


Mcginkel wrote:
I know that you cannot use write() while parsing an xhtml document. I
just assume I can write a new document once into another window or
frame. so not modifying the original doc. Is that outside the scope of
the spec ?
It is hard to find anything definitive in the spec, if we look at the
W3C DOM Level 2 HTML module then it defines a method document.write for
both HTML 4 and XHTML 1.0 documents as the introduction in
<http://www.w3.org/TR/DOM-Level-2-HTML/> says:
"This specification defines the Document Object Model Level 2 HTML, a
platform- and language-neutral interface that allows programs and
scripts to dynamically access and update the content and structure of
[HTML 4.01] and [XHTML 1.0] documents."
and as the specification of document.write in
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-75233634> does to
list any exceptions that for XHTML 1.0 the method is not supposed to be
supported.
The specification of the open method here
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-72161170> does not
list any parameters and only speaks of strings of unparsed HTML.
So in terms of the W3C DOM the open method has no parameter to set a
MIME type.

As you have worked with XHTML. Is it worth migrating to ? The main
reason to change is the option to mix html with xml (simular to
dataislands in IE) and svg. The opinions on XHTML are quite diverse,
depending on who you speak. Is it solid enough to build appliactions in
a browser ?


My work with XHTML has been mostly experimental to explore the
differences between scripting HTML and XHTML and XML documents. My
conclusion so far is that it is not worth to bother with pure XHTML 1.0
as a replacement for HTML 4.01 as there are no advantages in terms of
HTML (XHTML 1.0 is a reformulation of HTML 4.01 and thus has the same
elements and attributes) and as writing XHTML 1.0 so that it is
backwards compatible with HTML is a hassle. With at least one major
browser (that is IE/Win) having no support for XHTML being served as
application/xhtml+xml if you want to use XHTML 1.0 you are however
forced to write in so it is backwards compatible to HTML and can be
served as text/html.
There are some people by now who use the HTTP accept header the user
agent sends to send XHTML 1.0 as text/html then to IE but as
application/xhtml+xml to browsers like Mozilla or Opera.
Scripting then even becomes more difficult as you have to write your
scripts so that they work in both environments.

And there are documented disadvantages, for instance the Mozilla web
devloper FAQ
<http://www.mozilla.org/docs/web-developer/faq.html#xhtmldiff> clearly
explains "The document is not loaded and rendered incrementally. That
is, the document is displayed only after the entire document has been
received and parsed."

So on the web in general I see no reason why you should use XHTML 1.0
instead of HTML 4.01.
If you were authoring for an intranet where you know all users using the
latest version of a browser supporting XHTML as application/xhtml+xml
you could of course decide differently, you do not have the hassle of
needing to write markup that both HTML/SGML and XHTML/XML parsers
understand and the hassle of writing scripts working in both environments.
Things are different when it comes to real advantages XHTML and XML has
to offer, you have named the integration of XHTML with other XML
applications like SVG or like MathML. There it certainly makes sense to
use XML but of course it is hardly possible to write applications for
the web in general that case, these are (at least currently) niche
applications requiring a particular user agent. Mozilla (since 1.0 I
think) can do XHTML 1.0 with MathML, Opera (since 8.0) can do XHTML 1.0
with SVG Tiny I think where script in the SVG is not supported, where no
SVG DOM is exposed, and where Core DOM manipulation of the SVG elements
at run time are not working reliably. The upcoming Firefox 1.5 will
allow mixed XHTML, MathML, SVG with scripting of SVG and some SVG DOM
exposed but obviously then writing for instance a mixed XHTML and SVG
document that works the same in Firefox 1.5 and Opera 8 needs a
developer carefully using features implemented by both browsers.
If you think XHTML helps to have then XML data islands in the HTML
document then I still think using HTML 4 and text/html for your HTML
document with script and then using your script and XMLHttpRequest to
load/parse the XML data gives you a broader browser support and easier,
more consistent scripting.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 27 '05 #6
Martin Honnen schrieb:


Martin Kurz wrote:

Can't answer your questions but one thing to remember on using iframes
in XHTML:
There is no iframe anymore in XHTML, so you shouldn't switch to XHTML
when you
want to use iframes.

That is nonsense, XHTML 1.0 is simply a reformulation of HTML 4 so it
has all the elements like <iframe>, <frameset>, <frame> and the target
attribute if you use the proper XHTML 1.0 DTD:
<http://www.w3.org/TR/xhtml1>


So it would be nice to point me to the iframe in the strcit-dtd:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
There's no Element iframe.
Aug 27 '05 #7

Martin Honnen wrote:
Mcginkel wrote:
I know that you cannot use write() while parsing an xhtml document. I
just assume I can write a new document once into another window or
frame. so not modifying the original doc. Is that outside the scope of
the spec ?


It is hard to find anything definitive in the spec, if we look at the
W3C DOM Level 2 HTML module then it defines a method document.write for
both HTML 4 and XHTML 1.0 documents as the introduction in
<http://www.w3.org/TR/DOM-Level-2-HTML/> says:
"This specification defines the Document Object Model Level 2 HTML, a
platform- and language-neutral interface that allows programs and
scripts to dynamically access and update the content and structure of
[HTML 4.01] and [XHTML 1.0] documents."
and as the specification of document.write in
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-75233634> does to
list any exceptions that for XHTML 1.0 the method is not supposed to be
supported.
The specification of the open method here
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-72161170> does not
list any parameters and only speaks of strings of unparsed HTML.
So in terms of the W3C DOM the open method has no parameter to set a
MIME type.

As you have worked with XHTML. Is it worth migrating to ? The main
reason to change is the option to mix html with xml (simular to
dataislands in IE) and svg. The opinions on XHTML are quite diverse,
depending on who you speak. Is it solid enough to build appliactions in
a browser ?


My work with XHTML has been mostly experimental to explore the
differences between scripting HTML and XHTML and XML documents. My
conclusion so far is that it is not worth to bother with pure XHTML 1.0
as a replacement for HTML 4.01 as there are no advantages in terms of
HTML (XHTML 1.0 is a reformulation of HTML 4.01 and thus has the same
elements and attributes) and as writing XHTML 1.0 so that it is
backwards compatible with HTML is a hassle. With at least one major
browser (that is IE/Win) having no support for XHTML being served as
application/xhtml+xml if you want to use XHTML 1.0 you are however
forced to write in so it is backwards compatible to HTML and can be
served as text/html.
There are some people by now who use the HTTP accept header the user
agent sends to send XHTML 1.0 as text/html then to IE but as
application/xhtml+xml to browsers like Mozilla or Opera.
Scripting then even becomes more difficult as you have to write your
scripts so that they work in both environments.

And there are documented disadvantages, for instance the Mozilla web
devloper FAQ
<http://www.mozilla.org/docs/web-developer/faq.html#xhtmldiff> clearly
explains "The document is not loaded and rendered incrementally. That
is, the document is displayed only after the entire document has been
received and parsed."

So on the web in general I see no reason why you should use XHTML 1.0
instead of HTML 4.01.
If you were authoring for an intranet where you know all users using the
latest version of a browser supporting XHTML as application/xhtml+xml
you could of course decide differently, you do not have the hassle of
needing to write markup that both HTML/SGML and XHTML/XML parsers
understand and the hassle of writing scripts working in both environments.
Things are different when it comes to real advantages XHTML and XML has
to offer, you have named the integration of XHTML with other XML
applications like SVG or like MathML. There it certainly makes sense to
use XML but of course it is hardly possible to write applications for
the web in general that case, these are (at least currently) niche
applications requiring a particular user agent. Mozilla (since 1.0 I
think) can do XHTML 1.0 with MathML, Opera (since 8.0) can do XHTML 1.0
with SVG Tiny I think where script in the SVG is not supported, where no
SVG DOM is exposed, and where Core DOM manipulation of the SVG elements
at run time are not working reliably. The upcoming Firefox 1.5 will
allow mixed XHTML, MathML, SVG with scripting of SVG and some SVG DOM
exposed but obviously then writing for instance a mixed XHTML and SVG
document that works the same in Firefox 1.5 and Opera 8 needs a
developer carefully using features implemented by both browsers.
If you think XHTML helps to have then XML data islands in the HTML
document then I still think using HTML 4 and text/html for your HTML
document with script and then using your script and XMLHttpRequest to
load/parse the XML data gives you a broader browser support and easier,
more consistent scripting.
--

Martin Honnen
http://JavaScript.FAQTs.com/


It seems xhtml 1.0, of which there are transitional, strict, and frame
set species, has been the focus of this discussion. Xhtml 1.1 has been
out quite a while now and an even newer version, which will require new
browsers, is in the works. I only code in xhtml 1.1 now and see
absolutely no advantage of using a 1.0 species at this late date. Of
course what html-xhtml version you wish to use is a matter of personal
taste - even html 3.2 still works on most browsers.

It has been claimed that xhtml 1.1 can not be served as html. However,
in many cases this is not true, although there is likely no advantage
in doing so rather than using html 4.01 strict. The W3C just says xhtml
1.1 should not be served as html. However, they say that xhtml must not
be served as html. It is likely that the next version of xhtml will
specify that it must not be served as html. I suspect that the W3C did
not use "must not" for xhtml 1.1 because of IE6 and relatives that can
not accept the mime type application/xhtml-xml.

I am serving true application/xhtml+xml in some of my more recent
pages. A simple php include at the very top of the php page detects if
the browser will accept application/xhtml+xml. If so, everything needed
for xhtml 1.1 above the head tag is automatically included in the page.
If the mentioned mime type support is not detected, then code above the
page for html 4.01 strict is written. The php include also uses a
simple regular expression to convert <br /> and such to <br> if an html
page must be used.

When you use xhtml 1.1 served as application/xhtml+xml, browsers that
can handle it become very strict and parse your code as xml. If there
is the least little error, the page does not display and you get a xml
parse error message instead. In general document.write just gives a
blank page or an error message. The xml parser can see right through
script, comment tags, etc. The main xml no-no is anything that is not
closed. The problem with document.write is there is no telling what
this might contain, including unclosed tags and symbols with special
xml meaning. Thus document.write can not be allowed. In some cases you
can build up what you need from the DOM to replace document.write.
However the easy way is to use server side script. For example, I had
one old page where document.write was at the bottom of a nest of 3 if
loops and was executed about 2500 times. It was easy to convert this
portion of the script to a server side php script. Thus the browser is
sent all of the code generated by the document.write php replacement,
and the xml parser has no problem checking all of this code for
unclosed tags, etc. You can also use server side Perl or several other
languages if any of them strike your fancy more than php.

I likely will soon be posting some examples of rather complicated pages
served in both xhtml 1.1 and html 4.01 strict as needed by the viewing
browser. These pages include some server side php script. This will
hopefully make what I discussed above more clear.

Aug 27 '05 #8


Martin Kurz wrote:
Martin Honnen schrieb:

Martin Kurz wrote:
There is no iframe anymore in XHTML, so you shouldn't switch to XHTML
when you
want to use iframes.

That is nonsense, XHTML 1.0 is simply a reformulation of HTML 4 so it
has all the elements like <iframe>, <frameset>, <frame> and the target
attribute if you use the proper XHTML 1.0 DTD:
<http://www.w3.org/TR/xhtml1>

So it would be nice to point me to the iframe in the strcit-dtd:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
There's no Element iframe.


There is also no iframe element in HTML 4.01 strict so your claim "There
is no iframe anymore in XHTML" is nonsense, if you want to write valid
HTML 4.01 with an iframe then you need to use the transitional HTML 4.01
DTD and if you want to write valid XHTML 1.0 with an iframe then you
need to use the transitional XHTML 1.0 DTD.
There is no change regarding iframes from HTML 4.01 to XHTML 1.0.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 27 '05 #9

cw******@yahoo.com wrote:
It has been claimed that xhtml 1.1 can not be served as html. However,
in many cases this is not true, although there is likely no advantage
in doing so rather than using html 4.01 strict. The W3C just says xhtml
1.1 should not be served as html. However, they say that xhtml must not
be served as html. It is likely that the next version of xhtml will
specify that it must not be served as html. I suspect that the W3C did
not use "must not" for xhtml 1.1 because of IE6 and relatives that can
not accept the mime type application/xhtml-xml.


I reversed two words in a sentence. The statement: " However, they say
that xhtml must not be served as html." should read: " However, they
say that html must not be served as xhtml."

Aug 27 '05 #10
Martin Kurz wrote:
Martin Honnen schrieb:
Martin Kurz wrote: <snip>
There is no iframe anymore in XHTML, so you shouldn't
switch to XHTML when you want to use iframes.


That is nonsense, XHTML 1.0 is simply a reformulation of
HTML 4 so it has all the elements like <iframe>, <frameset>,
<frame> and the target attribute if you use the proper
XHTML 1.0 DTD:
<http://www.w3.org/TR/xhtml1>


So it would be nice to point me to the iframe in the
strcit-dtd:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
There's no Element iframe.


There is no IFRAME in the strict HTML DTD either (and no other sorts of
frames), but they do exist in the transitional XHTML 1.0 DTD.

Richard.
Aug 27 '05 #11
Martin Honnen wrote:
My work with XHTML has been mostly experimental to explore the
differences between scripting HTML and XHTML and XML documents. My
conclusion so far is that it is not worth to bother with pure XHTML 1.0
as a replacement for HTML 4.01 as there are no advantages in terms of
HTML (XHTML 1.0 is a reformulation of HTML 4.01 and thus has the same
elements and attributes) and as writing XHTML 1.0 so that it is
backwards compatible with HTML is a hassle. With at least one major
browser (that is IE/Win) having no support for XHTML being served as
application/xhtml+xml if you want to use XHTML 1.0 you are however
forced to write in so it is backwards compatible to HTML and can be
served as text/html.


So defy them. Explain to the suckers that they're using a broken browser
sold by criminals, and they should replace it.

--
John W. Kennedy
If Bill Gates believes in "intelligent design", why can't he apply it to
Windows?
Aug 28 '05 #12
John W. Kennedy wrote:
Martin Honnen wrote:

<snip>
.. . With at least one major browser (that is IE/Win) having
no support for XHTML being served as application/xhtml+xml
if you want to use XHTML 1.0 you are however forced to write
in so it is backwards compatible to HTML and can be served
as text/html.


So defy them. Explain to the suckers that they're using a broken
browser sold by criminals, and they should replace it.


That sounds like a good way of becoming unemployed. In the commercial
world if the end results don't work on IE then you haven't done your job
at all.

Richard.
Aug 28 '05 #13
Richard Cornford wrote:
John W. Kennedy wrote:
Martin Honnen wrote:


<snip>
.. . With at least one major browser (that is IE/Win) having
no support for XHTML being served as application/xhtml+xml
if you want to use XHTML 1.0 you are however forced to write
in so it is backwards compatible to HTML and can be served
as text/html.


So defy them. Explain to the suckers that they're using a broken
browser sold by criminals, and they should replace it.

That sounds like a good way of becoming unemployed. In the commercial
world if the end results don't work on IE then you haven't done your job
at all.


OK, but don't complain when your grandchildren have to kiss Lord Gates's
feet.

--
John W. Kennedy
"You can, if you wish, class all science-fiction together; but it is
about as perceptive as classing the works of Ballantyne, Conrad and W.
W. Jacobs together as the 'sea-story' and then criticizing _that_."
-- C. S. Lewis. "An Experiment in Criticism"
Aug 28 '05 #14
John W. Kennedy wrote:
Richard Cornford wrote:
John W. Kennedy wrote:
Martin Honnen wrote:

<snip>
.. . With at least one major browser (that is IE/Win) having
no support for XHTML being served as application/xhtml+xml
if you want to use XHTML 1.0 you are however forced to write
in so it is backwards compatible to HTML and can be served
as text/html.

So defy them. Explain to the suckers that they're using a
broken browser sold by criminals, and they should replace it.


That sounds like a good way of becoming unemployed. In the
commercial world if the end results don't work on IE then
you haven't done your job at all.


OK, but don't complain when your grandchildren have to kiss Lord
Gates's feet.


That would be the style of argument known as the "slippery slope", and
not generally regarded as valid.

Richard.
Aug 29 '05 #15
Can we do the iframe/gates bashing in a seperate forum ? I really
appriciate it when people take the time to answer the questions in this
news group. It is valuable for me.

So to summarize :
- Document.open("...") and document.write are not the supported for
xhtml, not even for the first creation of the document. This leave me
with no way to create an xhtml document in an iframe or window from
scripting (synchronious).
- There are no ways to wait for a completion event (or yield) in
javascript.
- XHTML is not supported by all browsers, so you can use it only when
you can choose which browsers you support. (intranet/company).
- If you use it make sure to set the mimetype differently for IE
(text/html) and mozilla (application/xhtml+xml). Make sure that the xml
is properly formatted and be aware of the suttle differences
(loading/innerhtml etc)

Thanks for the input.
Kees

Aug 29 '05 #16
Mcginkel wrote:
Can we do the iframe/gates bashing in a seperate forum ? I really
appriciate it when people take the time to answer the questions in
this news group. It is valuable for me.

So to summarize :
- Document.open("...") and document.write are not the supported for
xhtml, not even for the first creation of the document. This leave me
with no way to create an xhtml document in an iframe or window from
scripting (synchronious).
It should be fairly obvious why - document.open/write - cannot create a
document of any type; the document object must exist before you can call
any of its methods, and so must already be of some type when that
happens. That is; the distinction between an XHTML and an HTML DOM
applies to the - document - object and all of its descendants in the
browser's object model.
- There are no ways to wait for a completion event (or yield) in
javascript.
This assumption needs to be seriously questioned as it is trivial for
javascript to preserve entire execution contexts, suspending processes
at some point and then resuming them later in response to events or
actions. This is the ability that allows the use of asynchronous
XmlHttpRequsets (and much else aside in an event driven environment that
should be programmed to be asynchronous).
- XHTML is not supported by all browsers, so you can use it only
when you can choose which browsers you support. (intranet/company).
- If you use it make sure to set the mimetype differently for IE
(text/html) and mozilla (application/xhtml+xml). Make sure that the
xml is properly formatted and be aware of the suttle differences
(loading/innerhtml etc)


It is important to note, and seemingly under appreciated, that when a
document is served with the MIME type text/html it is (will be
interpreted as, and must be scripted as) an HTML document, regardless of
any similarities that its mark-up might bare to XHTML (i.e. Appendix C
XHTML 1.0 served as text/html is formally malformed HTML _not_ XHTML
(certainly as far as the receiving browser is concerned)).

Richard.
Aug 31 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: aragon | last post by:
Hi all, is it legal to use a fully-numeric string as "name" attribute for the <select> tag in the XHTML standard? E.g.: <form action="action.php" method="get"> <select name="12345"> <option...
2
by: Brian Idzik | last post by:
I've successfully setup a xhtml 1.0 strict page with Mozilla & Netscape to display links in a toolbar into an internal <div id='content'> within the same document. The toolbar uses some...
2
by: David Bradbury | last post by:
I currently have an iframe on a webpage into which users can insert content. They can further customise the text as I've included buttons such as Bold, Italic, Bullet point etc. This is done along...
7
by: Simon Strandgaard | last post by:
There are no <iframe> tag in xhtml strict, instead I should use <object>. If I change <iframe> to <object> then my javascript stops working. I am curious to how to use <object> with javascript...
8
by: Alan Lue | last post by:
Hi, I'm trying to set up a webpage so that I can view multiple HTML files from the same page. For example, you might go to http://example.com/lab_tests.html and be able to view lab1.html,...
3
by: Frank Thomas | last post by:
So, where are we (as an industry) with regards to XHTML? I've been going through a book published in 2002 that promotes the idea that we should all be looking to create new projects as compliant...
14
by: Dario de Judicibus | last post by:
I think that is really important to have the «src» attrinbute in tags other than «img» in order to include XHTML fragments without depending on server-side mechanisms as ISS or PHP. For example: ...
20
by: Alan Silver | last post by:
Hello, I have read about the problems that IE has when using a doctype of HTML 4.01 Transitional. I was advised to use Strict wherever possible. My question is, does the same apply to XHTML...
4
by: stephen.cunliffe | last post by:
Hi all, There's been a bunch of chatter recently about using the Object tag, vs. the Iframe tag. I couldn't care less which one is used, I just want to be able to load a "page" inside another...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.