cccicl
cccicl
发布于 4个月前

Js script src加载blob对象

let jsCookieScripts = document.createElement("script");
jsCookieScripts.type = "text/javascript";

var blob = new Blob(["alert('Hello World!')"], { type: "text/plain;charset=utf-8" });

jsCookieScripts.src = URL.createObjectURL(blob);
document.documentElement.appendChild(jsCookieScripts)
©2020 edoou.com   京ICP备16001874号-3