Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

IE6 compatibility for module.externalDependency

  • Loading branch information...
commit b68a18e5070e1d5c883faaaf5f66c449d8624c04 1 parent d6ceb11
@paulbaumgart paulbaumgart authored
Showing with 16 additions and 14 deletions.
  1. +1 −1  package.json
  2. +15 −13 tmpl/bundle.tmpl
View
2  package.json
@@ -3,7 +3,7 @@
"name": "jsbundle",
"description": "Simple, clean, and automatic bundling of your Node modules and packages for use in the browser.",
"keywords": "browser require bundle module package static-analysis",
- "version": "0.13.1",
+ "version": "0.13.2",
"repository": {
"type": "git",
"url": "git://github.com/proxv/jsbundle.git"
View
28 tmpl/bundle.tmpl
@@ -46,24 +46,26 @@
}
function loadScript(url, index) {
- var scriptNode = document.createElement('script');
- scriptNode.setAttribute('src', url);
+ var head = document.head || document.getElementsByTagName('head')[0] || document.documentElement;
+ var script = document.createElement('script');
+
+ script.src = url;
+
+ script.onload = script.onreadystatechange = function() {
+ if (!script.readyState || /loaded|complete/.test(script.readyState)) {
+ script.onload = script.onreadystatechange = null;
+
+ if (head && script.parentNode) {
+ head.removeChild(script);
+ }
+
+ script = null;
- scriptNode.onload = function() {
- if (!scriptNode.onloadDone) {
- scriptNode.onloadDone = true;
- registerScriptLoad(url, index);
- }
- };
- scriptNode.onreadystatechange = function() {
- if ((scriptNode.readyState === 'loaded' || scriptNode.readyState === 'complete') &&
- !scriptNode.onloadDone) {
- scriptNode.onloadDone = true;
registerScriptLoad(url, index);
}
};
- document.getElementsByTagName('head')[0].appendChild(scriptNode);
+ head.insertBefore(script, head.firstChild);
}
Please sign in to comment.
Something went wrong with that request. Please try again.