HighDots Forums  

Nested OBJECT frustration

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Nested OBJECT frustration in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Philip Ronan
 
Posts: n/a

Default Nested OBJECT frustration - 10-06-2005 , 03:26 PM






Hi,

I'm having problems embedding alternative content with nested OBJECT tags.

Take a look at <http://www.japanesetranslator.co.uk/chihiro/map.html>

The map on this page is available in SVG, Flash, JPEG and ASCII art
versions. The first two are there because they print at much higher
resolution than the JPEG, so I'm keen to keep them in if possible.

Although I've built the page according to the HTML specs for nested objects,
it seems to fall apart completely in IE 5.1/Mac, which displays all three
graphics versions (but not the ASCII art, for some reason).

Am I doing something wrong? Is there an easy fix for the IE problem? Does
the same thing happen in IE/Windows?

Thanks in advance...

Phil

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/



Reply With Quote
  #2  
Old   
Philip Ronan
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-06-2005 , 07:21 PM






"Philip Ronan" wrote:

Quote:
Hi,

I'm having problems embedding alternative content with nested OBJECT tags.

Take a look at <http://www.japanesetranslator.co.uk/chihiro/map.html
Update: Since the page is live, I've had to resort to UA sniffing for the
time being. If you're using internet Explorer, you will get redirected to a
different page without any OBJECT tags. If you want to see the original
page, visit <http://www.japanesetranslator.co.uk/chihiro/map-original.html>
instead.

Sorry about that.

Phil

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/




Reply With Quote
  #3  
Old   
Spartanicus
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-06-2005 , 07:25 PM



Philip Ronan <invalid (AT) invalid (DOT) invalid> wrote:

Quote:
Although I've built the page according to the HTML specs for nested objects,
it seems to fall apart completely in IE 5.1/Mac, which displays all three
graphics versions (but not the ASCII art, for some reason).

Am I doing something wrong?
No.

Quote:
Is there an easy fix for the IE problem?
No.

Quote:
Does the same thing happen in IE/Windows?
Probably, IE/Win doesn't handle object elements properly, nested or
otherwise. Various Opera versions also have trouble with nested objects.

--
Spartanicus


Reply With Quote
  #4  
Old   
Philip Ronan
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-07-2005 , 04:26 AM



"Spartanicus" wrote:

Quote:
Does the same thing happen in IE/Windows?

Probably, IE/Win doesn't handle object elements properly, nested or
otherwise. Various Opera versions also have trouble with nested objects.
Ho-hum. So I've just been wasting my time basically :-/ I never realised
the support for objects was still so pathetic. (How old is HTML 4.01 now? 6
years?)

I've added Opera to the sniffing conditions. Is there any authoritative info
out there on which browsers support object nesting? At the moment I'm
weeding out IE versions 5-6 and Opera versions 5-8

Phil

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/




Reply With Quote
  #5  
Old   
Spartanicus
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-07-2005 , 05:20 AM



Philip Ronan <invalid (AT) invalid (DOT) invalid> wrote:

Quote:
I never realised
the support for objects was still so pathetic. (How old is HTML 4.01 now? 6
years?)
4.0 is dated 24th April 1998.

Quote:
I've added Opera to the sniffing conditions. Is there any authoritative info
out there on which browsers support object nesting?
I don't know.

Quote:
At the moment I'm
weeding out IE versions 5-6 and Opera versions 5-8
Browser sniffing is fundamentally flawed. That said IIRC only Opera
v7.5x has problems with nested objects.

--
Spartanicus


Reply With Quote
  #6  
Old   
Philip Ronan
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-07-2005 , 05:54 AM



"Spartanicus" wrote:

Quote:
Philip Ronan <invalid (AT) invalid (DOT) invalid> wrote:

At the moment I'm
weeding out IE versions 5-6 and Opera versions 5-8

Browser sniffing is fundamentally flawed. That said IIRC only Opera
v7.5x has problems with nested objects.
I just tested the page with Opera 6.0/Mac and it didn't display any maps at
all. So I'll leave things the way they are FTTB.

I'm aware of the pitfalls of browser sniffing, but at least this way
everybody gets *something*, and nobody gets a mangled page with 3 maps, or
no maps, or some other useless result. Unless -- that is -- they've modified
a broken browser to identify itself as something functional, in which case I
don't really care what happens :-)

Besides, the normal way to avoid the need for browser sniffing is to write
valid W3C compliant HTML. I don't see how that's possible in this case.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/




Reply With Quote
  #7  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-07-2005 , 05:56 AM



On Fri, 7 Oct 2005, Philip Ronan wrote:

Quote:
"Philip Ronan" wrote:

Hi,

I'm having problems embedding alternative content with nested OBJECT tags.

Take a look at <http://www.japanesetranslator.co.uk/chihiro/map.html

Update: Since the page is live, I've had to resort to UA sniffing
"If that was the answer, it must have been a silly question". You
don't say how you're trying to do that, but I don't see any javascript
trying to do it on the client side, and, since the HTTP response
contains no Vary: header, if your machinery is on the server-side then
it isn't correct, since the cache server will treat the non-MSIE
response as cacheable, and then serve it out to whoever asks for it,
no matter which browser they are using. Anyway, server-side
negotiation on the user agent string is basically crazy.

There's really only two successful strategies for doing something like
that, IMHO.

1. capitalise on known bugs in the affected browser versions. This is
how the well-known CSS-hiding strategies work for browsers with
defective CSS support. I don't have a particular method to offer you
in this case, admittedly, but there could well be one.

2. If the browser in question is MSIE, as it usually seems to be (and
evidently is in this case), then use the MS-defined "conditional
comments", which, if used carefully, can be harmless to WWW-compatible
browsers. This, I feel sure, would be do-able.

In either case, your source code would be a static page with no
server-side machinery needed, and no negative implications for
cacheability.

good luck


Reply With Quote
  #8  
Old   
Philip Ronan
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-07-2005 , 06:59 AM



"Alan J. Flavell" wrote:

Quote:
On Fri, 7 Oct 2005, Philip Ronan wrote:

Since the page is live, I've had to resort to UA sniffing

"If that was the answer, it must have been a silly question". You
don't say how you're trying to do that, but I don't see any javascript
trying to do it on the client side
Javascript would mean having to load all 3 versions of the map. The Flash
file is particularly large, so I'd rather not go down that road. I'm using a
RewriteRule to switch the content automatically at the server.

Quote:
and, since the HTTP response
contains no Vary: header, if your machinery is on the server-side then
it isn't correct, since the cache server will treat the non-MSIE
response as cacheable, and then serve it out to whoever asks for it,
no matter which browser they are using.
That's a very good point. Now fixed. :-)

Quote:
Anyway, server-side negotiation on the user agent string is basically crazy.
I'm not bothering with 300 response headers, I'm just making a snap decision
based on the User-Agent request header.

Quote:
There's really only two successful strategies for doing something like
that, IMHO.

1. capitalise on known bugs in the affected browser versions...
Trouble is, this problem affects at least two browsers, so I think it would
be difficult to keep them both happy with valid markup. Besides, this
approach is liable to involve serving all three versions of the map,
resulting in longer load times. (FYI, the SVG file is 11 KB, the JPEG is 23
KB, and the SWF is 86 KB. Loading all three would take quite a while.)

Quote:
2. use the MS-defined "conditional comments"...
Wouldn't work with Opera. :-(

Quote:
In either case, your source code would be a static page with no
server-side machinery needed, and no negative implications for
cacheability.
Cacheability isn't such a big deal in this case (apart from the Vary header
issue you brought up). It's a small page that doesn't get that many hits.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/



Reply With Quote
  #9  
Old   
Stephen Poley
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-07-2005 , 04:23 PM



On Fri, 7 Oct 2005 10:56:44 +0100, "Alan J. Flavell"
<flavell (AT) ph (DOT) gla.ac.uk> wrote:

Quote:
2. If the browser in question is MSIE, as it usually seems to be (and
evidently is in this case), then use the MS-defined "conditional
comments", which, if used carefully, can be harmless to WWW-compatible
browsers.
Is that "if used carefully" just a general caveat, or have you some
particular case in mind where attempts to use conditional comments
screwed up other browsers? (I do use them, so I'd like to know of
anything particular that needs to be watched out for.)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/


Reply With Quote
  #10  
Old   
Alan J. Flavell
 
Posts: n/a

Default Re: Nested OBJECT frustration - 10-10-2005 , 01:51 PM



On Fri, 7 Oct 2005, Stephen Poley wrote:

Quote:
On Fri, 7 Oct 2005 10:56:44 +0100, "Alan J. Flavell"
flavell (AT) ph (DOT) gla.ac.uk> wrote:

2. If the browser in question is MSIE, as it usually seems to be
(and evidently is in this case), then use the MS-defined
"conditional comments", which, if used carefully, can be harmless
to WWW-compatible browsers.

Is that "if used carefully" just a general caveat, or have you some
particular case in mind where attempts to use conditional comments
screwed up other browsers?
At the URL:
http://msdn.microsoft.com/workshop/a...nal_Statements

there are two kinds of "conditional comment" listed (following the
first line, which exhibits "standard HTML comment"). The first of the
two appears to be harmless, since it conforms with the W3C
recommendations for HTML comments (provided, of course, one manages to
avoid the character sequence "--" inside of the comment!). However,
the second one looks to me to be dubious, since it relies on a browser
ignoring a syntax that *should* contain material which is meaningful
in SGML terms.

I've already encountered at least one browser that took the W3C claim
that "HTML is an application of SGML" rather more literally than was
good for it (it was emacs-w3), and attempted to process material which
was in accordance with one of the rules of SGML (but not in accordance
with the limited de facto usage of HTML). That experience causes me
to be dubious of this too: although I'm not personally aware of any
actual damage caused by this particular MSoftism, I think I would try
to avoid using it if I possibly could, just in case something similar
was provoked somewhere.

Quote:
(I do use them, so I'd like to know of
anything particular that needs to be watched out for.)
You will note, of course, with a wry smile, that advanced browsers
like Mozilla are designated as "downlevel browsers" compared with
MSIE5, in MS's topsy-turvy world. :-}

Anyway, my summary is:

* their "downlevel-hidden" comments look OK - evidently "--" should be
avoided inside the comment, but I don't see any reason to need that.

* their "downlevel-revealed" comments look more dubious, and I'd try
to avoid them if possible, though I can't produce an actual example
of harm caused by them.

hope that helps


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.