lazyload is a very good product,
we are going to use it in chinese environment now, but it only supports utf8 charset when loading js/css files.
i know that utf8 is the best choice, but in our sites there is lots of old js/css files using non-unicode charsets such as gbk, gb2312, etc.
so i suggest to add custom charset support:
// lazyload.js 2.0.3
// line 218 add:
var charset = '';
var match = url.match(/\[charset=([a-zA-Z0-9-]+)\]$/);
if (match) {
charset = match[1];
url = url.replace(match[0], '');
}
// line 230 change to:
if (charset != '') node.setAttribute('charset', charset);
lazyload is a very good product, we are going to use it in chinese environment now, but it only supports utf8 charset when loading js/css files. i know that utf8 is the best choice, but in our sites there is lots of old js/css files using non-unicode charsets such as gbk, gb2312, etc. so i suggest to add custom charset support:
or
Either one would be fine.
and here is the code for the first form:
Thanks