Is there a way to inject charset: "utf-8"
to yepnope using load method without using yepnope.injectJs
method
yepnope({
load: newResourcesToBeLoaded,
complete: function() {
addNewlyLoadedResources(newResourcesToBeLoaded);
completeCallback();
}
});
Not easily, but you can use a filter to do it:
If you're having any of the issues I had though this won't help, scripts without the charset attribute should pick up the document's charset (from
Content-Type
header or<meta charset>
tag) anyway. There are problems in some browsers when loading UTF-8 encoded files with a BOM (byte order mark) defined, Firefox notably for me.Also, yepnope.js attempts to load scripts in non-IE/Opera browsers as tags apparently, this was the source of all my issues and eventually made me change to LABjs instead.