Skip to content
Browse files

Merge pull request #232 from mdumic/fix-171

Added fix to enable asynchronous loading in IE (fixes #171 and #175)
  • Loading branch information...
2 parents 6c3ad9e + 2574bd6 commit 79ea413a3aadc30d8cffb05faade6e003d9e7e5a @sorccu committed Feb 10, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 js/cufon.js
View
11 js/cufon.js
@@ -975,8 +975,10 @@ Cufon.registerEngine('vml', (function() {
check = null;
var HAS_BROKEN_LINEHEIGHT = (document.documentMode || 0) < 8;
-
- document.write(('<style type="text/css">' +
+
+ var styleSheet = document.createElement('style');
+ styleSheet.type = 'text/css';
+ styleSheet.styleSheet.cssText = (
'cufoncanvas{text-indent:0;}' +
'@media screen{' +
'cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}' +
@@ -994,8 +996,9 @@ Cufon.registerEngine('vml', (function() {
'}' +
'@media print{' +
'cufon cufoncanvas{display:none;}' +
- '}' +
- '</style>').replace(/;/g, '!important;'));
+ '}'
+ ).replace(/;/g, '!important;');
+ document.getElementsByTagName('head')[0].appendChild(styleSheet);
function getFontSizeInPixels(el, value) {
return getSizeInPixels(el, /(?:em|ex|%)$|^[a-z-]+$/i.test(value) ? '1em' : value);

0 comments on commit 79ea413

Please sign in to comment.
Something went wrong with that request. Please try again.