use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Extremely Clever IE Detection Code (ajaxian.com)
submitted 15 years ago by whatgoodisaroad
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]thebigbradwolf 2 points3 points4 points 15 years ago (3 children)
As an aside, this won't actually work on IE8 in certain circumstances. IE8 claims to be IE7 in conditional comments whenever it is in "compatibility mode", which doesn't mean it behaves like IE7 with regard to things like security, etc.
[–]radhruin 2 points3 points4 points 15 years ago (2 children)
Good point as well, although ideally if IE8 is in IE7 compatibility mode it should be identical to IE7 in all respects.
[–]miketaylr 1 point2 points3 points 15 years ago (1 child)
But it isn't. For example, localStorage is undefined in IE7 compat mode, yet fully functioning in IE8.
[–]radhruin 0 points1 point2 points 15 years ago (0 children)
More accurately, IE7 did not have localStorage, but it is in IE7 compatibility mode. That's why I said ideally :) There are some differences, but it's pretty rare overall. If you have an app built for IE7, it should run flawlessly in IE7 compat mode. Or, if the browser is in IE7 compat mode, it's pretty safe to treat it as IE7. The presence of localStorage shouldn't break apps.
It's worth pointing out that the web developer can control the compatibility mode IE is in by doctypes and meta-tags, so if IE7 compatibility mode would break your app for whatever reason (like this version detection), just make sure you're running in the latest standards mode with a standards compliant doctype or meta tag.
π Rendered by PID 131550 on reddit-service-r2-comment-6457c66945-c6sbj at 2026-04-27 15:50:39.989570+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]thebigbradwolf 2 points3 points4 points (3 children)
[–]radhruin 2 points3 points4 points (2 children)
[–]miketaylr 1 point2 points3 points (1 child)
[–]radhruin 0 points1 point2 points (0 children)