Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Location
    New Brunswick, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Code displaying in IE instead of webpage

    Well, I always knew I hated IE for a reason...

    My latest problem is rather unusual, however. I have created an online art and photography portfolio for my mother, and have temporarily located it here: http://geaw.atspace.com/

    (Since I have no idea exactly what part of the coding is the problem, I request that you view the site yourself to see the coding... I don't want to clutter up the page by posting all my XHTML and both stylesheets.)

    It works beautifully in Firefox, Opera, and Netscape.

    IE doesn't just screw it up (well, it did, but I have a separate stylesheet with hacks to solve that), instead, it just doesn't display it at all! What it displays is the code itself, as if you had hit the "View Source" button.

    This is the same in IE7 and IE5.5, according the NetRenderer.com, so I assume IE6 is as well (for some reason NR gave me an error when trying to show version 6).
    Also, Avant, being that it uses the same engine as IE, has the same problem.

    The weirdest part, is that my local copy of the website works fine (with the hacks) in IE. It is only when I actually upload it to the Internet that it breaks.

    I've tried a number of things with the code, even changing the doctype, but nothing affected it at all. So I simply added a bit to my comment at the top of my code, warning visitors that they will need to use Firefox, Opera, or Netscape in order to view it.
    (This is not a problem, as this is the temporary location, and I have only shown the link with the intention of getting opinions on the design. I'm not expecting clients just yet.)

    It's something that utterly baffles me. I don't even know if the problem deals with the XHTML or CSS! The site is 100% valid XHTML 1.0 Strict and valid CSS.
    It still works in other browsers, so it can't be the host's fault.

    My poor head is so confused. I need help... T_T

  • #2
    Regular Coder
    Join Date
    Feb 2007
    Location
    Seattle
    Posts
    153
    Thanks
    5
    Thanked 9 Times in 9 Posts
    I copied your exact code (minus the style sheet) to my web server and got the same results as you in IE7; raw xml code.

    I then created a new xhtml strict barebones document in Dreamweaver, and copied all your content from just below the <html> tag thru the </html> tag to this new page and uploaded it... and it looks perfect. Go figure.

    http://www.garydarling.net/geaw.html

    http://www.garydarling.net/geaw2.html

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Location
    New Brunswick, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Huh. I checked the source code of both, and the only difference is that the second one is missing the big comment at the top.

    I guess that must have been the problem (though why in the world it's a problem is beyond me).

    Thanks. I'm going to try removing the comment from my original coding and see if it works for me.

    *Jeopardy music plays*

    Yep! That was the problem! And when I replace the code, but put it after the <html> tag, it also works fine.

    I guess, for some reason, IE just doesn't like comments being placed before the <html> tag. *kicks IE* Bah. Why the local copy worked is still a mystery... but whatever.

    (Why didn't I think to try that...? Oh well.)


    Thanks again!

  • #4
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Hmm... Looks like the style sheet is not loading?
    Quote Originally Posted by Goldmare View Post
    I guess, for some reason, IE just doesn't like comments being placed before the <html> tag. *kicks IE* Bah.
    It seems like you don't know about quirks mode.

    If you insert comments and stuff before the document type declaration then you may be triggering quirks mode in IE6/7.

    There are differences when and when not quirks mode is triggered in various browsers. I believe the following holds true:

    White space before the document type:
    IE6, IE7, Firefox: does not trigger quirks mode

    <!-- comments --> or any stray characters before doctype:
    IE6, IE7: triggers quirks mode
    Firefox: does not trigger quirks mode

    with an xml declaration before the doctype
    IE6: triggers quirks mode
    IE7, Firefox: does not trigger quirks mode

    Therefore, if you want standards mode in all browsers, then, generally, never put anything before the document type declaration. (And be sure to pick a document type that triggers standards mode)

  • #5
    New to the CF scene
    Join Date
    Aug 2007
    Location
    New Brunswick, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by koyama View Post
    Hmm... Looks like the style sheet is not loading?
    He purposely left out the stylesheets so as to focus purely on the html.

    Quote Originally Posted by koyama View Post
    It seems like you don't know about quirks mode.
    Well, I do know about quirks mode... we went over it when I took a web developer course in college. They did not, however, explain that there were certain things you could do to accidentally trigger quirks mode. They really should have... -_-

    Quote Originally Posted by koyama View Post
    If you insert comments and stuff before the document type declaration then you may be triggering quirks mode in IE6/7.
    Well, that's annoying. However, the error I was receiving had nothing to do with which mode it was in... and besides, my comment wasn't before the doctype at all. It was between the doctype and the <html> tag (which was the actual problem).

    Quote Originally Posted by koyama View Post
    with an xml declaration before the doctype
    IE6: triggers quirks mode
    IE7, Firefox: does not trigger quirks mode
    Hm? But the xml declaration is supposed to go before the doctype, isn't it? (I've found that, if you put anything before the xml declaration, W3C's html validator complains mightily, so you can't put it after the doctype...)

    Although, I have no way of testing the mode in IE6, since I have IE7.

  • #6
    Senior Coder koyama's Avatar
    Join Date
    Dec 2006
    Location
    Copenhagen, Denmark
    Posts
    1,246
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Goldmare View Post
    Hm? But the xml declaration is supposed to go before the doctype, isn't it?
    It is, but you can't use it if you want standards mode in IE6. But the xml declaration is not required, so leaving it out shouldn't be a problem.

    The real question may be why you are even using (fake) XHTML. Strict HTML may be the correct choice:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Read what Arbitrator has to say about fake XHTML: http://codingforums.com/showpost.php...39&postcount=9

    Quote Originally Posted by Goldmare View Post
    Although, I have no way of testing the mode in IE6, since I have IE7.
    Besides being rendered in quirks mode there are rendering issues in IE6. I captured a screen shot for you. The background is partly missing.

  • #7
    New to the CF scene
    Join Date
    Aug 2007
    Location
    New Brunswick, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by koyama View Post
    The real question may be why you are even using (fake) XHTML. Strict HTML may be the correct choice:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Read what Arbitrator has to say about fake XHTML: http://codingforums.com/showpost.php...39&postcount=9
    Point taken, but I am so used to XHTML, that I simply use it out of habit. I'm not sure if I even remember how to write in proper HTML. ^^; Does it matter?


    Quote Originally Posted by koyama View Post
    Besides being rendered in quirks mode there are rendering issues in IE6.
    Ah, that I already knew. I use NetRenderer for that. (When I was still experiencing the original error, it wouldn't take a screenie in version 6 for some reason, but it works now.)

    The rendering problem was occurring in IE7 as well, but I came up with a hack that solved the issue. For some reason, the hack isn't working for IE6 or IE5.5. I really don't know why, but I'm working on it. Thanks for letting me know anyway.

    It is for reasons like this that IE is hated... I wish people would wake up and start using Firefox or Opera. Even my mom uses IE. Alas...

  • #8
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    IE strikes again! ;/
    For web design in Doncaster visit www.electronic-monkeys.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •