通过部分html文件添加对norton安全徽标JS文件(下面复制)的引用时,收到以下错误:
Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened
我没有使用延迟加载库或角度更改,而是使用JQuery文档就绪调用来加载JS文件,但我没有遇到所需的行为,即Norton徽标没有加载。
<div id="sslLogo"></div>
<script type="text/javascript">
function loadLogo(sslLogoContainer) {
"use strict";
var sslLogoScript = document.createElement('script');
sslLogoScript.type = 'text/javascript';
sslLogoScript.src = 'https://seal.websecurity.norton.com/getseal?host_name=www.test.com&size=L&use_flash=NO&use_transparent=NO&lang=en';
sslLogoContainer.appendChild(sslLogoScript);
}
$(document).ready(function () {
var sslLogoContainer = document.getElementById("sslLogo");
loadLogo(sslLogoContainer);
});
/*
window.onload = {
var sslLogoContainer = document.getElementById("sslLogo");
loadLogo();
}*/
</script>
有关如何解决问题的任何想法?我修改了用于stackoverflow的norton url。