Detect IE8 Compatibility Mode [duplicate]

IE8 includes a trident token in the User-Agent string regardless of compatibility mode. See MSDN for more details: The Internet Explorer 8 User-Agent String (Updated Edition) IE7 on Windows Vista Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) IE8 on Windows Vista (Compatibility View) Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0) IE8 on Windows Vista … Read more

contenteditable=false inside contenteditable=true block is still editable in IE8

Okay, I already have discovered the answer much like how Penicillin was discovered. You see, playing around with this code, I mistakenly set contenteditable to true for the span and voila! It worked! So, to make a span NON-contenteditable inside a contenteditable div, you just set its contenteditable attribute to true! <div contenteditable=”true”> Luke, I … Read more

How can I use console logging in Internet Explorer?

You can access IE8 script console by launching the “Developer Tools” (F12). Click the “Script” tab, then click “Console” on the right. From within your JavaScript code, you can do any of the following: <script type=”text/javascript”> console.log(‘some msg’); console.info(‘information’); console.warn(‘some warning’); console.error(‘some error’); console.assert(false, ‘YOU FAIL’); </script> Also, you can clear the Console by calling … Read more

JavaScript KeyCode Values are “undefined” in Internet Explorer 8

It looks like under IE8 the keyCode property of window.Event is undefined but that same property of window.event (note the lowercase e) has the value. You might try using window.event. function doSubmit(e) { var keyCode = (window.event) ? e.which : e.keyCode; if (keyCode == 13) document.getElementById(“ctl00_ContentPlaceHolder1_Login”).click(); }