do not add crossOrigin attribute on same origin scripts

This commit is contained in:
nightwing 2015-03-15 18:41:41 +00:00
parent 82b56224ba
commit 329ac9812e

View File

@ -93,7 +93,8 @@ function loadScript(path, token, callback) {
var and = path.indexOf("?") >= 0 ? "&" : "?";
s.src = path + (token ? and + "access_token=" + encodeURIComponent(token) : "");
s.crossOrigin = true;
if (s.src.indexOf("://" + window.location.host) == -1)
s.crossOrigin = true;
head.appendChild(s);
s.onload = s.onreadystatechange = function(_, isAbort) {