```js
function loadResource(resourceSrc) {
   var extension = getExtension(resourceSrc);
   
   var node = extension === 'js' ? document.head.querySelector('script[src=' + '"' +
                                                 resourceSrc + '"]') : document.head.querySelector('link[href=' + '"' +
                                                 resourceSrc + '"]');

   if (node && !resourcesLoaded[resourceSrc]) {
        // Would be nice if Firefox would have a readyState attribute as IE
        addEventListeners(node);
   } else if (resourcesLoaded[resourceSrc] === true) {
       resourceLoaded(resourceSrc);      }    
   } else {
       extension === 'js' ? loadScript(resourceSrc) : loadStyle(resourceSrc);
   }
}
```