Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2 from studio31design/master

Fixed Double-firing in IE9
  • Loading branch information...
commit 7b61e3368c629a5efb6758f2849b51ba1efab0da 2 parents 441cf14 + 84b32ef
Oleg Slobodskoi authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/jquery.xLazyLoader.js
9 src/jquery.xLazyLoader.js
View
@@ -148,9 +148,12 @@ function xLazyLoader ()
var link = $('<link rel="stylesheet" type="text/css" media="all" href="'+ href + key + '" id="'+name+'"></link>')[0];
if ( $.browser.msie ) {
- link.onreadystatechange = function () {
- /loaded|complete/.test(link.readyState) && callback();
- };
+ link.onreadystatechange = function (){
+ if (link.readyState == "loaded" || link.readyState == "complete") {
+ link.onreadystatechange = null;
+ callback();
+ }
+ }
} else if ( $.browser.opera ) {
link.onload = callback;
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.