homepage Welcome to WebmasterWorld Guest from 54.161.214.221
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
How do you detect ie rendering mode
I'm sure this is obvious or answered but can't find it
aevea




msg:572107
 3:02 am on Oct 10, 2003 (gmt 0)

I'm trying to figure out how to tell for any given page whether ie6 is rendering in quirks mode or strict mode. Is there a favelet or something that will do it?

I started a page like this:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

thinking it would trigger standards compliance mode, but I'm having some weird problems.

Thanks,
Adam

 

macrost




msg:572108
 4:07 am on Oct 10, 2003 (gmt 0)

What type of problems are you having with this?

Mac

Jobarr




msg:572109
 7:29 am on Oct 10, 2003 (gmt 0)

Remove the XML prolog
(<?xml version="1.0" encoding="iso-8859-1"?> )

IE is stupid and doesn't understand it and jumps into quirks mode.

MonkeeSage




msg:572110
 8:40 am on Oct 10, 2003 (gmt 0)

Here is a favlet based on NickH's info about the compatMode property. It also works in Opera and Mozilla, BTW.

javascript:(function(){var mode=document.compatMode,m;if(mode){if(mode=='BackCompat')m='Quirks';else if(mode=='CSS1Compat')m='Standards Compliance';else m='Almost Standards Compliance';alert('The document is being rendered in '+m+' Mode.');}})();

Jordan

aevea




msg:572111
 2:28 pm on Oct 10, 2003 (gmt 0)

Thanks Jordan, that's just what I needed. Sorry for my ignorance, but how do I put that into the favorites to make it run. I love the way you can just right-click in firebird to see the mode.

Jobarr, will removing the xml declaration mess anything else up? I thought it was needed for validation.

The problems are just differences in positioning between opera/mozilla and ie6.

Thanks,
Adam

Jobarr




msg:572112
 9:58 pm on Oct 10, 2003 (gmt 0)

No, the prolog is optional. As long as the doctype is there it should render in standards compliance mode.

MonkeeSage




msg:572113
 10:17 pm on Oct 10, 2003 (gmt 0)

Hey Adam, just create a fluff favorite for any site you want, then go edit your favorites and change the name of it to something more appropriate, then paste all the code from javascript:...(); as the URL. Then save your favorites and try clicking on the new one from the favorites menu and you should get the document mode for whatever page you are looking at at the time it is run. :)

Jordan

aevea




msg:572114
 10:47 pm on Oct 10, 2003 (gmt 0)

Thanks,
Works like a charm (really).

The document is being rendered in quirks mode

All beautiful valid pages are rendered in quirks mode. I have a feeling it's going to be a long weekend.

Adam

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved