Separated the creation of the resource reference into two methods, one
for JS and one for CSS.