IE formatting issue when placing code at top of page

Posted on 2006-03-20
Last Modified: 2013-12-24
Somebody please help!

I am building an authorization system. A part of the system is adding pages that are to be protected. The way it will work is that a superuser will be able to browse parts of the site and click on a drop-down box at the top of any page and assign a role to that page to make it protected. I am testing the format of how the secure bar is going to work. You can see an example here:

As you can see, the bar sits at the top of the page with the drop-down box. It works fine in Firefox, Camino, and Safari, but as soon as I check it in IE on the PC it changes the formatting of the rest of the page. I know this is because I have viewable code where there isn't supposed to be any. The code is being called from the onRequestStart method in my Application.cfc file. This is why it must show up first on the page. Is there anyway to fix it so that IE does not change the formatting of the rest of the page? Also, I would rather not input an output variable on all the pages within the body text just to get this to fix. I am attempting to do this all through the onRequestStart function.

Question by:remmuh
    LVL 2

    Author Comment

    I did a quick cheap fix. I added all the header info that goes at the top of the page to fool ie into thinking the body had started. Sure this goes against all W3C standards, but you do what you gotta do sometimes. any other ideas would be great thanks.
    LVL 18

    Expert Comment


    FYI, it works fine in IE7 when I tested it. So Ie6 was probably breaking some standards.

    LVL 2

    Author Comment

    indeed. thanks for the input.
    LVL 7

    Expert Comment

    No, it's not breaking standards.  By putting content before the doctype, you're triggering quirks mode.  This is known behavior.  In order to generate valid code, you need to figure out how to get these bits and bobbles within the body of the document.  I'd recommend an include with your conditional code for whether to display the extra bits and bobbles or not.

    Accepted Solution

    PAQed with points refunded (250)

    Community Support Moderator

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now