Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

IE formatting issue when placing code at top of page

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:

http://www.realradioactive.org/administration/

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.

Thanks
-Kyle
0
remmuh
Asked:
remmuh
1 Solution
 
remmuhAuthor Commented:
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.
0
 
PluckaCommented:
remmuh,

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

Regards
Plucka
0
 
remmuhAuthor Commented:
indeed. thanks for the input.
0
 
JeffHowdenCommented:
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.
0
 
GranModCommented:
PAQed with points refunded (250)

GranMod
Community Support Moderator
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now