473,324 Members | 2,214 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,324 software developers and data experts.

Nested OBJECT frustration

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/
Oct 6 '05 #1
10 1983
"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 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/
Oct 6 '05 #2
Philip Ronan <in*****@invalid.invalid> wrote:
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.
Is there an easy fix for the IE problem?
No.
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
Oct 6 '05 #3
"Spartanicus" wrote:
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/
Oct 7 '05 #4
Philip Ronan <in*****@invalid.invalid> wrote:
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.
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.
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
Oct 7 '05 #5
"Spartanicus" wrote:
Philip Ronan <in*****@invalid.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/
Oct 7 '05 #6
On Fri, 7 Oct 2005, Philip Ronan wrote:
"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
Oct 7 '05 #7
"Alan J. Flavell" wrote:
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.
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. :-)
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.
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.)
2. use the MS-defined "conditional comments"...
Wouldn't work with Opera. :-(
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/

Oct 7 '05 #8
On Fri, 7 Oct 2005 10:56:44 +0100, "Alan J. Flavell"
<fl*****@ph.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? (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/
Oct 7 '05 #9
On Fri, 7 Oct 2005, Stephen Poley wrote:
On Fri, 7 Oct 2005 10:56:44 +0100, "Alan J. Flavell"
<fl*****@ph.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.
(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
Oct 10 '05 #10
On Mon, 10 Oct 2005 18:51:22 +0100, "Alan J. Flavell"
<fl*****@ph.gla.ac.uk> wrote:
On Fri, 7 Oct 2005, Stephen Poley wrote:
On Fri, 7 Oct 2005 10:56:44 +0100, "Alan J. Flavell"
<fl*****@ph.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.


OK. I've only ever used the first one.
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. :-}
Indeed. :-/
hope that helps


Yes, thanks.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Oct 10 '05 #11

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

Similar topics

2
by: Simon | last post by:
Hi, I am having a little problem with my PHP - MySQl code, I have two tables (shown below) and I am trying populate a template page with data from both. <disclaimer>Now I would like to say my...
26
by: Joshua Beall | last post by:
Hi All, I remember reading that both nested classes and namespaces would be available in PHP5. I know that namespaces got canceled (much sadness...), however, I *thought* that nested classes...
3
by: Erik Bongers | last post by:
Hi, Nested classes only seem to be able to access static members of the surrounding class : class SurroundingClass { public: class InnerClass { public:
8
by: Robert W. | last post by:
I've almost completed building a Model-View-Controller but have run into a snag. When an event is fired on a form control I want to automatically updated the "connnected" property in the Model. ...
2
by: miked | last post by:
I am architecting in a read only class for use in mapping data to a business object. The object makes strong use of nested classes and their ability to access protected fields. The downside is...
37
by: Tim N. van der Leeuw | last post by:
Hi, The following might be documented somewhere, but it hit me unexpectedly and I couldn't exactly find this in the manual either. Problem is, that I cannot use augmented assignment operators...
5
by: ZikO | last post by:
Hi there. I have a problem. I have created nested classes but don't know how to access to inner classes. I know I can create objects: Hen Object; Hen::Nest ObjectNest; Hen::Nest::Egg...
0
by: Maric Michaud | last post by:
Le Tuesday 12 August 2008 11:29:18 Cousson, Benoit, vous avez écrit : This is a language limitation. This is because nested scope is implemented for python function only since 2.3 allow late...
7
by: brasse | last post by:
Hello! I have been running in to some problems when using contextlib.nested(). My problem arises when using code similar to this: from __future__ import with_statement from contextlib...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.