mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
Only add defer to inline script tags, addressed #334
This commit is contained in:
parent
1bffefedf5
commit
89be873dba
@ -160,7 +160,13 @@ function getPreparedCode(nojs) {
|
||||
// }
|
||||
|
||||
if (jsbin.ie && re.scriptopen.test(source)) {
|
||||
source = source.replace(re.scriptopen, '<script defer');
|
||||
source = source.replace(/<script(.*?)>/gi, function (all, match) {
|
||||
if (match.indexOf('src') !== -1) {
|
||||
return all;
|
||||
} else {
|
||||
return '<script defer' + match + '>';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// read the element out of the source code and plug it in to our document.title
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user