File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,17 @@ module.exports = function loadScript (options, callback) {
2929    script . async  =  true ; 
3030    script . src  =  options . src ; 
3131
32-     var  firstScript  =  document . getElementsByTagName ( 'script' ) [ 0 ] ; 
33-     firstScript . parentNode . insertBefore ( script ,  firstScript ) ; 
34- 
3532    // If we have a callback, attach event handlers, even in IE. Based off of 
3633    // the Third-Party Javascript script loading example: 
3734    // https://github.com/thirdpartyjs/thirdpartyjs-code/blob/master/examples/templates/02/loading-files/index.html 
3835    if  ( callback  &&  type ( callback )  ===  'function' )  { 
3936        onload ( script ,  callback ) ; 
4037    } 
4138
39+     // Append after event listeners are attached for IE. 
40+     var  firstScript  =  document . getElementsByTagName ( 'script' ) [ 0 ] ; 
41+     firstScript . parentNode . insertBefore ( script ,  firstScript ) ; 
42+ 
4243    // Return the script element in case they want to do anything special, like 
4344    // give it an ID or attributes. 
4445    return  script ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments