通过部分 html 文件添加对诺顿安全徽标 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。