10 July 2004

IE's duplicate characters bug (DCB)

Earlier this week I was working our ecommerce system ( www.retailplus.bz – new site in the pipeline), bringing it inline with web standards, and getting rid of older techniques. In the process of doing so Internet Explorer's duplicate characters bug reared its ugly head.

I have faced this foe before, but I could not remember its weak point so that I could kill it. Thus, I went to the oracle of IE bugs for help - Big John at Position Is Everything.

After reading the page about our mean little critter, I spent a good deal of time looking for the HTML comments that PIE told me is the cause of my bug. I didn't find them and so I began to curse the air.

After that I gave up on it for a while, and did something else. When I came back to it the answer was staring me in the face like an unhappy trout. It was in fact a hidden form field.

It seems that HTML comments are not the only elements that can summon the DCB, but also other HTML elements that are hidden from view. After letting John know about this, he updated his page, theorising that elements set to display:none; might also have the same effect. I haven't tried this, and I am worried that John might have misunderstood the email I sent. I will have to check with him.

But, anyway, enough of that nonsense, and my silly way of telling you that hidden form elements also cause the DCB as well as HTML comments.

Comments ( 8 )

  1. Malarkey

    Eh up Phil,

    The IE double margin bug is fairly easy to deal with as PIE describes. But only this week I saw your suggestion on PIE on the subject of the Duplicate Characters bug in IE6.

    This little critter is a pig to deal with sometimes and I found out from bitter experience that elements hidden with display:none DO cause the issue...

    Well spotted matey...
    11 July 2004 at 01:48
  2. Phil Baines

    Haha

    Yes, um, I did this to late in the day! It was ment to be "Duplicate Characters" not margin. Doh!

    No more blogging after beers, in the middle of a LAN party.
    12 July 2004 at 09:35
  3. Luc

    Double or nothing?

    Ah, the double margin bug... yes after reading the beer stuff i understand. I use display: none also but never had the double character bug so i was a bit confuzzled at first lol
    13 July 2004 at 01:34
  4. Phil Baines

    beer does funny things

    yeh, i think the correct circumstances are so obscure that it just hasnt been noticed before.
    13 July 2004 at 14:22
  5. DrDoc

    Double margin, duplicated characters and such...

    I don't ever worry about them. If there's ever duplicated characters and such, just add display:inline to the floated element. In fact, always add display:inline to all floated elements to avoid other funky bugs in IE.
    21 July 2004 at 05:50
  6. DrDoc

    Bug trigger...

    > After letting John know about this, he updated his page,
    > theorising that elements set to display:none; might also
    > have the same effect. I haven't tried this, and I am
    > worried that John might have misunderstood the email I
    > sent. I will have to check with him.

    I don't think he misunderstood it. The fact is, any "non-content" element will trigger the bug, such as:

    <!-- regular comments -->
    display:none;
    <input type="hidden">
    <script type="text/javascript"> </script>
    ...etc.

    None of the above elements generate any substantial content, which means they also all trigger the bug.
    21 July 2004 at 06:33
  7. Big John

    Hallelujah!

    Ah, so this is where the current CSS wonks hang out, eh? A fine thing! Now, yet again, I must rewrite my pore old demos. Alas, I'm starting to feel like an extra wheel. Oh well, perhaps my previous work will allow me to "hang" with the young turks a while longer before retirement sets in. Sure hope so.

    Oops, I almost forgot; Woohoo! Rainer has conquered the 3px jog, and that is no small thing. So easy to fix, but so evil without the fix. I salute you.
    21 July 2004 at 08:05
  8. Phil Baines

    well well

    Hay, nice to see a few new names. Welcome to my humble piece of the web.

    DrDoc, yes, Big John is right, and so are you. I think Malarkey pointed that out to me above.

    Big John, I dont know if this is 'the place', and I am sure that there are better places around. I am glad that you made it here anyway, and the more people that come this way, the better.
    21 July 2004 at 09:24

Sorry, commenting has been disabled for a while. I am getting a stupid amount of comment spam, and need to find a new way of doing things.

I will not publish your email address, but I may use it to get in contact with you.

HTML tags and entities display as source; they do not render. To create a live link, simply type the URL (including http://).

Topics

  • I am more than willing to admit the big gaps in my knowledge on many topics, including web development. This is a topic I use to get help from the community, and my imaginary audience.
    Ask the Audience
  • Even though looking pretty is not the most important layer to a succesful web site (I don't think there is a Most Important), it does help!
    Graphic Design
  • Have you got a sense of?
    Humor
  • The glam, the sadness, the joy, the madness.
    Life of Findel
  • What ever doesn't fit
    Misc
  • I have a crappy camera, but I do try. A good artist always blames his tools.
    Photography
  • Here I chat about projects I am working on, going to work on, or finished. Some of them I will be happy to let you in on, others I will be ashamed of.
    Project Watch
  • Site news and updates
    Site Info
  • Keepin' an eye on the wwwubb
    Watching The Web
  • This topic will be used for talking about all manner of project management issues relating to Wed Development (Wubb Development). Where we may talk about how to code in the Wubb Development topic, we will be more likely to talk about giving quotes, or planning projects, in this topic.
    Working with Wubbs
  • All things Web Development - Web standards, Hacks, Graphics, and more.
    Wubb Development