]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#340] mustache plugin using getScript
authorScottDowne <sdowne@learn.senecac.on.ca>
Mon, 7 Mar 2011 14:54:25 +0000 (09:54 -0500)
committerScottDowne <sdowne@learn.senecac.on.ca>
Mon, 7 Mar 2011 14:54:25 +0000 (09:54 -0500)
plugins/mustache/popcorn.mustache.js

index 5cca26fefb050ef8631bb157056c6d68e14b8faa..f3934458685ad651b4bc6b9dafb8ae37e1632376 100644 (file)
@@ -2,17 +2,7 @@
 
 (function (Popcorn) {
 
-  // TODO: swap to getScript()
-  (function() {
-    var mustacheUrl = 'https://github.com/janl/mustache.js/raw/master/mustache.js';
-
-    var head = document.getElementsByTagName('head')[0];
-    var script = document.createElement('script');
-
-    script.type = 'text/javascript';
-    script.src = mustacheUrl;
-    head.insertBefore( script, head.firstChild );
-  })();
+  Popcorn.getScript('https://github.com/janl/mustache.js/raw/master/mustache.js');
 
   /**
    * Mustache Popcorn Plug-in