Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed Double-firing in IE9 #2

Merged
merged 1 commit into from

2 participants

@studio31design

Upon page refresh, it double-fires in IE9. We implemented this fix.

@kof kof merged commit 7b61e33 into kof:master
@kof
Owner

applied, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 23, 2011
  1. @studio31design
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/jquery.xLazyLoader.js
View
9 src/jquery.xLazyLoader.js
@@ -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 {
Something went wrong with that request. Please try again.