Advertisement
Promo

Story: Firefox? Bah Humbug, I say

  • Previous comment

Posted by: Ole Clausen (Sunday 7 November 2004, 8:01 AM)

  • Reply

Hi John.
I read your article today. Sorry to say, but the problems are some you and IE introduce together :)

With the DTD you use, IE goes into quirks-mode and act as wrongly as it always has done. It simply doesn't comply to W3C standards.
To make it switch into standard-complient mode, you have to have the URL present in the DTD:

Read about it here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp

If you set a relative height on an element, it takes the height from it's containing element - according to the W3C Box-Model. Therefore, you have to set the height on each element - also the body and the documentElement (the 'html-element'). In most ways the two latter are not different from other HTML-elements.
Your CSS-code should look something like this:

html, body {
height: 100%;
overflow: hidden;
margin: 0px;
padding: 0px; /*Opera needs this*/
}
body
{
background-image: url('demoback.gif');
}
... and so on.

But as you set your div-container to be 100% of 100% of 100% ... it doesn't matter what overflow you give it. When you have overflow:hidden on the containing elements, it'll get no scrollbar.
No offence - but you ought to brush up your CSS-knowledge. FireFox is infact showing your page according to W3C and the code, you have written - IE is not :)

You can always test if the browser is in standard-complient mode with JavaScript:
alert(document.compatMode)
... returns 'CSS1Compat' if in standard-complient mode. Opera returns 'QuirksMode' - all others 'BackCompat' if not.

The JavaScript you write about is infact not JavaScript, but ECMA-DOM bindings. They are under W3C's control while the JavaScript standard is Netscape's standard. You can use ECMA-DOM bindings in both JavaScript, JScript and VBScript
It is correct, that you can use document.all, but document.getElementById is hell of a lot faster in all IE's after 5.0. It may not matter if you call only one element - but it makes a lot of difference in a larger DHTML application.

And talking about JavaScript, the JavaScript pseudo-protokol was designed for running JS in the address-line of the browser - instead of the the FTP- or HTTP-protokol. The link's href was designed for page-navigation.
Therefore it makes the code more logic, if you use the link's onclick-handler, that was designed for nothing but handling JS:
B
instead of:
B
By returning false, you disable the default action of the link - and you can infact write what ever you like in the href. If the client has disabled JS nothing bad will happen with a hash-mark, though ;o)

Talking about :)
TEST
Will open a popup if JS is enabled - and just navigate to the page if not ;o)

I work as Interface Developer ... this is what I do.
I'm not 'religious' in any way ... not especially pro or contra this or that ... I'm not a DIV/CSS-mullah, but use a lot of tables, when they are best for the job.
On the other hand - I know the W3C recommandations inside out ... I know the browsers from NS2/IE3 and up inside out ... I write JavaScript like others write shopping-lists. Trust me, I know what I'm talking about :)

I didn't feel like hanging you out to dry by commenting on the article, so I tried to mail you - but your address doesn't work.
I don't feel a need to proof myself, but would like to teach you a couple of tricks instead. Now I write it here anyway - and hope, you don't feel offended :)

  • Previous comment

  • Reply to this comment
  • Return to story
  • Report this as offensive


Full Talkback thread

Story: Firefox? Bah Humbug, I say

  1. You're weird. Alexandre Juneau
  2. Forget Browsers getting anoyed at not being p... Samuel
  3. Bad luck about the traps inherent in standards est... Thomas Flewell
  4. You misunderstand how CSS height works. The outer... Jason Barnabe
  5. John Carrol? Bah Humbug, I say. John Carrol is one... Arthur B.
  6. Firefox measures up to the challenge: Carrol... Anonymous
  7. Well of course John Carroll says 'Bah! Humbug!'. I... Chris Rankin
  8. I agree with Chris view but, wanted to uneart... sanjay
  9. I've found you can eliminate most browser inconsis... Damien Conlon
  10. Having been involved in several e-commerce pr... David Wright
  11. The whole point of a browser is to view web pages.... Mark Jamies
  12. I have started using Firefox in the past few... Tim Jensen
  13. Older browsers? Come on guys. You know t... squid
  14. squid wrote: "Older browsers? Come... Anonymous
  15. Sentient AI is something that humans develop.... Kaisa Hannele Tervola
  16. http://yansanmo.no-ip.org:8080/test/css/bah-humbug... kwanbis
  17. Is this article simply saying that the author has... Gareth Williams
  18. John Carroll. You are a muppet. I honestly cannot... Anonymous
  19. Hi John. I read your article today. Sorry to say,... Ole Clausen
  20. To Ole Clausen, thanks for your thoughtful re... John Carroll
  21. John Carroll writes: I take it, though,... Ted Powell
  22. In other news, I suggest that the Oxford... Anonymous
  23. Save us from all the giant browsers needed for par... Ole Clausen
  24. Firefox is actually the browser that is rendering... Anonymous
  25. When using any software application, including the... Sam Alexander
  26. John Carrol writes: Likewise, as my article sugges... Adam
  27. John, you write: "As a web developer, I have to de... Ole Clausen
  28. It's about time! I know very little about web-deve... Bryan markis
  29. I am reporting you and your anti-FireFox article i... Ignatius Reilly
  30. If Firefox is a Bag umbug, what IE is? Anonymous
  31. Its Insane to judge firefox on this. The page you'... David Hyde
  32. Finally, some balance to the pointless rounds of I... Terry Pettitt
  33. The very fact that you ignore the advantages of CS... Anonymous
  34. Hi John, I wanted to let you know that I have quot... Chris Beach
  35. Like Chris, I was glad to see someone saying what... Josh Titcomb
  36. I have been using Firefox for sometime now and fou... trevor johnson
  37. alexandre juneau you stole my name for i too go by... alexandre juneau

Back to: Firefox? Bah Humbug, I say


Skip Sub Navigation Links to CNET Brand Links

Help

Become part of the ZDNet community.

Newsletters