diff --git a/src/Core.js b/src/Core.js index a29e6cb..36fc121 100644 --- a/src/Core.js +++ b/src/Core.js @@ -205,13 +205,12 @@ _html2canvas.Util.BackgroundPosition = function ( el, bounds, image ) { }; _html2canvas.Util.Extend = function (options, defaults) { - var key; - for (key in options) { + for (var key in options) { if (options.hasOwnProperty(key)) { defaults[key] = options[key]; } } - return defaults; + return defaults; }; _html2canvas.Util.Children = function(el) { diff --git a/src/Preload.js b/src/Preload.js index 93723bd..9bbebf7 100644 --- a/src/Preload.js +++ b/src/Preload.js @@ -183,6 +183,7 @@ _html2canvas.Preload = function( options ) { images.numLoaded++; imageObj.succeeded = true; + img.onerror = img.onload = null; start(); }; img.onerror = function() { @@ -207,6 +208,7 @@ _html2canvas.Preload = function( options ) { images.numLoaded++; images.numFailed++; imageObj.succeeded = false; + img.onerror = img.onload = null; start(); }; diff --git a/src/plugins/bookmarklet.js b/src/plugins/bookmarklet.js index 7a79309..d9ed5fc 100644 --- a/src/plugins/bookmarklet.js +++ b/src/plugins/bookmarklet.js @@ -16,11 +16,10 @@ 'src/plugins/jquery.plugin.html2canvas' ], relFiles = [ - '//code.jquery.com/jquery-1.6.4.js', + '//code.jquery.com/jquery-1.6.4.js', 'html2canvas', 'jquery.plugin.html2canvas' - ], - i = 0, el = null; + ]; var loader = { index: 0, head: document.getElementsByTagName('head')[0], @@ -37,12 +36,12 @@ el.onerror = function() { _.statusline.style.color = 'red'; _.statusline.innerHTML = _.statusline.innerHTML + ' failed'; - _.statusline.onclick = function() { + _.statusline.onclick = function() { _.statusline.parentNode.removeChild(_.statusline); }; }; - if (_.files[_.index].substr(0, 2) === '//') { - el.src = _.files[_.index]; + if (_.files[_.index].substr(0, 2) === '//') { + el.src = _.files[_.index]; } else { el.src = server + '/' + _.files[_.index] + '.js'; @@ -56,7 +55,8 @@ delete _.statusline; $(document.documentElement).html2canvas({ logging: debug, - profile: profile + profile: profile, + proxy: proxy }); } }