Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var ExternalScript = {
  include: function( src ){
    this._remove(src);
    var s = document.createNode('script');
    s.setAttribute('type', 'text/javascript');
    s.setAttribute('src', src);
    $$('html head').first.appendChild(s);
  },
  _remove: function(src){
    $$( 'script[src]' ).each( function( s ){
      if ( s.src.indexOf( src ) > -1 ) s.parentNode.removeChild( s );
    });
  }
}