0

i'm trying to disable my website when a user access the site in ie and use the quirks mode, someone know a script in php or javascript that disable or verify this case?

Thanks.

gabrielbuzzi
  • 343
  • 1
  • 3
  • 15

2 Answers2

2

You can check document.compatMode and see if it matches "CSS1Compat".

var isQuirky = (document.compatMode !== 'CSS1Compat');
if (isQuirky === true) {
  alert('Your browser is rendering this page in quirks mode, and it may not display properly.');
}
SpenserJ
  • 802
  • 5
  • 13
2

You can check it using document.compatMode property

if document.compatMode is CSS1Compat then the mode is standard otherwise it is Quirk

document.compatMode==='CSS1Compat'?'Standards':'Quirks') + ' mode.'