Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

V3.0 #131

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

V3.0 #131

wants to merge 15 commits into from

Conversation

fboggle
Copy link

@fboggle fboggle commented Aug 2, 2018

I was adding integrity and crossorigin attributes to the previous version of LABjs. I know that it is no longer in active development so I thought I would propose the following addition to preloadResource and loadResource. There is a TODO for handling resource types in each routine. I added the following code to each routine where the TODO is:

if (registryEntry.opts) {
for ( var opt in registryEntry.opts ) {
if ( registryEntry.opts.hasOwnProperty(opt) && 'src' !== opt ) {
elem.setAttribute( opt, registryEntry.opts[opt] );
}
}
}

This preserves the feature of passing .script({src: "http://foobar.com/x.js", type: "text/whatever", charset: "EBCDIC"}) but makes it extensible.
index.js.txt

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants