|
Posted by cwdjrxyz@yahoo.com on 11/13/30 11:26
cwdjrxyz@yahoo.com wrote:
> Leif K-Brooks wrote:
> > cwdjrxyz@yahoo.com wrote:
> > > You will notice a php include at the top of the code. This include
> > > file may be seen at http://www.cwdjr.net/calendar2/mime.txt . I am
> > > now serving many new pages in true xhtml 1.1 using the correct mime
> > > type of application/xhtml+xml for the extension .xhtml on the server.
> > > What the include code does is to detect if the viewing browser will
> > > accept the mentioned mime type.
>
> > Your script will serve application/xhtml+xml to a browser with an Accept
> > header of "text/html,application/xhtml+xml;q=0.1', which is completely
> > broken behavior. Opera, one example of a browser with such an Accept
> > header, will fail to handle HTML entity references in
> > application/xhtml+xml documents.
>
> There is no problem with recent versions of Opera, Mozilla, Netscape,
> Firefox, IE6, MyIE2, MSN9, and another two more obscure browsers for
> which I have been sent screen shops. I test my many pages served in
> this way on all of the mentioned browsers. If Opera or any other
> browser lies that it will accept application/xhtml+xml, that is
> apparently no problem in rendering the page. Opera does accept the page
> as xhtml 1.1 as you can see by viewing the source code while on Opera,
> or it will accept a page without a php include that has the extension
> .xhtml which is assigned to the mime type application/xhtml_xml on the
> server. On contrast IE6 accepts the html 4.01 strict code as you can
> see when viewing on IE6. If you try to force the mentioned page without
> a php include and with the extension .xhtml, the page is not displayed
> at all on IE6. Now it would be no surprise to me if Opera lies, because
> it can lie about what browser it is in the navigator.appName and call
> itself IE6, etc. However, even if it claims it accepts
> application.xhtml+xml in header information and then processes as
> text/html instead, it has built in changes to process the true xhtml
> code you deliver properly in so far as rendering the page is concerned.
> Of course all of this has no bearing on my answer to the question,
> because you can just as well serve a page as html 4.01 strict only with
> only the php server script to validate input.
>
>
> > > I have added an alert to pop up if a browser that will not support
> > > application/xhtml+xml is detected and the viewer has script turned
> > > on. This is my protest of the lack of standards compliance of IE6,
> > > which is the main current browser that will not support true xhtml
> > > 1.1.
> >
> > So you're punishing your visitors, many of whom may have no choice in
> > browser, for Microsoft's behavior? If I were forced to use IE (like I
> > was for a month last year) and received an annoying popup every time I
> > viewed a page on your site, you would lose a visitor.
>
> You failed to complete quoting my discussion on this issue, which
> concluded:
>
> How to remove this alert is shown in the source
> code, as you would not want this on a commercial site that wants to
> sell something.
>
> I do not use this alert on my many general web pages, since even I get
> tired of looking at it when checking pages on IE6. I use it only on
> pages that mention the IE6 problem to underline the problem. However,
> there always is a comment in the source code when html 4.01 strict is
> delivered rather than xhtml 1.1.
>
> Of course one is free to use any level of xhtml/html they wish. So far
> as I know, html 3.2 still works on current browsers and can be made to
> validate as such at the W3C. Of course you could not use style sheets
> in html 3.2, since CSS only came in as part of html 4. For me the time
> has come to switch most new pages to true xhtml 1.1. There are several
> other considerations, especially concerning javascript, that must be
> considered as well as what was mentioned here. After all xhtml 1.1 has
> been around quite a while now and the W3C has a newer version of xhtml
> in the works. This new version will require new browsers, however.
I should add that I detect only application/xhtml+xml to choose the
header to use. Some in the past have also detected the q and used this
to determine if the browser prefers this mime type or if it prefers
plain vanilla html. However if the browser says it accepts the
mentioned mime type, I force it to do so. One should then keep in mind
that the browser might still have a few bugs for true xhtml if you so
force. The Mozilla family of Mozilla, Firefox and Netscape in their
recent versions have a problem with background color set in the style
sheet when serving true xhtml. However this bug is easily corrected, as
will be seen in one of my pages I will soon give. When you use my php
include code and force Opera and the Mozilla family, you find that all
of these browsers parse your page as xml and become extremely strict.
The least little xml error such as an unclosed tag gives you a xml
error message rather than a view of the page. Code in ordinary html can
be full of small errors and the page often will still display in some
form, but not true xhtml served as such. Also you will find that a page
that used document.write in a javascript will not display, as
document.write is forbidden. One reason is that a document.write could
produce code with unclosed tags or other forbidden xml things, so it
can not be allowed. The browser must be able to parse all code that is
downloaded as xml. Again, there are ways to handle this problem. Those
xml parsers can see right through script and comment tags, so it is
very difficult to hide things so they can not see them.
So far as Opera is concerned, it looks like a duck and quacks like a
duck when you apparently force it to use true xhtml served as such.
However those Opera code developers are full of tricks and, so for all
I know, it could really be a small goose with Hollywood makeup to make
it look like a duck :-) .
You may see a working page at
http://www.cwdjr.net/calendar2/perpetual_calendar.php. A text file is
at http://www.cwdjr.net/calendar2/perpetual_calendar.txt , and you will
have to right click and select show source if you use an IE6 browser
only. An earlier version of this page was written in javascript which
had a document.write at the bottom of a nest of 4 "for" loops to write
the needed divisions with their css to draw the calendar. On conversion
to true xhtml served as such, most of the code ended up as php script
on the server to overcome the document.write problem. The source will
also show you the corrections for the stylesheet background-color for
the Mozilla family of browsers, along with some comments about this.
Navigation:
[Reply to this message]
|