What about making this more functional:
```js
scriptElements.filter(function(script) {
	return script.attrib.type && scriptTypes.indexOf(script.attrib.type.toLowerCase()) > -1 && script.attrib.src;
}).map(function(script) {
	return script.attrib.src;
})
```