Tag: internet explorer

Is there a way to detect if the browser has subpixel precision?

Is there a way to detect if the browser has subpixel precision for elements ? IE9, unlike any of the other major browsers, has subpixel precision for its elements (an elements width can be 50.25px) and because of that, I need to treat a thing differently. One way is to use jQuery to detect the […]

How to force IE to reload javascript?

I’m using IE 8 on Vista, and everytime I change a javascript file and then start debugging, I have to hit Ctrl+F5 to have it reload my javascript. Is there any way to make it automatically reload javascript when I start debugging, but not lose the performance gains when just browsing the net? Yeah yeah […]

Javascript IE detection, why not use simple conditional comments?

In order to detect IE most Javascript libaries do all sort of tricks. jQuery seem to add a temporary object into your pages’s DOM to detect some features, YUI2 does regex on the user agent in its YAHOO.env.ua = function() (file yahoo.js) After reading this answer it came in my mind that it’s true, in […]

How to safely wrap `console.log`?

Suppose I want to include some calls to console.log for some legitimate production reason, say for something like a unit test harness. Obviously I would not want this to throw a premature exception if the browser doesn’t have a console, or if no console is present. What’s the best way to create a simple log […]

Access denied to jQuery script on IE

I have an iframe using the jQuery 1.4.2 script. The same iframe is injected into both http and https sites. The jQuery script is included in the main HTML file as a relative path (e.g., /scripts/jquery-1.4.2.min.js). When an AJAX call is made, Internet Explorer denies access. The AJAX is calling on another subdomain, but it’s […]

Stupefyingly weird IE 9 Javascript bug: Altering doc title makes subsequent code execute

I don’t understand this at all. Here is some Javascript code that works in every browser but IE 9. It is called from a Flash movie using ExternalInterface, and is meant to dynamically resize the movie in the DOM if the size of the movie changes internally function vResizeFlash(swfId, ht) { document.getElementById(swfId).height = “100%”; document.getElementById(‘flashContainer’).style.height […]

What causes the error “Can't execute code from a freed script”

I thought I’d found the solution a while ago (see my blog): If you ever get the JavaScript (or should that be JScript) error “Can’t execute code from a freed script” – try moving any meta tags in the head so that they’re before your script tags. …but based on one of the most recent […]

Testing for console.log statements in IE

Possible Duplicate: 'console' is undefined error for internet explorer If you have console.log statements in your code, Internet Explorer will throw a JavaScript error (at least in IE7 which is what our intranet users have installed). I am using Firefox for most of my development testing primarily because of the functionality provided by Firebug (where […]

Including js from raw.github.com

I have a github.com demo page that is linking to https://raw.github.com/…/master/…/file.js so that I don’t need to always copy the .js file over to the gh-pages branch every time it’s changed. This works in every browser except IE which complains: SEC7112: Script from https://raw.github.com/cwolves/jQuery-iMask/master/dist/jquery-imask-min.js was blocked due to mime type mismatch This complaint is coming […]

How can I target only Internet Explorer 11 with JavaScript?

What’s the least error-prone way to target just IE11 with JavaScript? Note: This should really only be done for analytics or informing the user what browser they’re using. For everything else, there’s feature detection.