Forum Moderators: open

Message Too Old, No Replies

Detect Safari's Rendering Mode

This only works on PC....

         

JAB Creations

5:27 am on Mar 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I came by this javascript, put it in a link form, and it works fine on every browser I've tested it with. However I have been unable to confirm this works whatsoever MAC computers at all. MY uneducated guess is that I am assuming this has something to do with DOM support on MACs?

Does someone know or have any clue how to detect Safari's rendering mode?

<a href="javascript:(function(){var mode=document.compatMode,m;if(mode){if(mode=='BackCompat')m='Quirks';else if(mode=='CSS1Compat')m='Standards';else m='an unknown';alert('The document is being rendered in '+m+' Mode.');}})();" ADD_DATE="1089763488" LAST_MODIFIED="1089763503" ID="rdf:#$+8vof1">Detect Rendering Mode</a>

dcrombie

10:16 am on Mar 25, 2005 (gmt 0)



[quirksmode.org...]

... Another possibility is to use Explorer's proprietary compatMode property...

;)

JAB Creations

11:30 pm on Mar 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry but huh?

I'm really NOT interested in IE on MACs as much as I am with Safari. I don't have any access to a MAC right now anyway.

bedlam

1:15 am on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The point was that the function you're using cannot work on Safari since it uses an IE-specific JS function - 'compatMode'.

-B

JAB Creations

10:29 am on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, thanks for clarifying ... JS isn't my strong point.

Rambo Tribble

2:34 pm on Mar 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Possibly, you would find the DOCTYPE declaration a subject of greater utility. The declaration, if properly chosen, will force a browser into a specific rendering mode.

Any of the declarations you find on this page should force a standards-compliant browser into standards-compatibility mode, the most predictable rendering mode for cross-platform reliability: [w3schools.com...]