因为js多线程web worker创建的子线程中不能对DOM进行操作,所以普通的js引用js并不能用。
document.write("...");//报错:document 未定义。
var imported = document.createElement('script');
imported.src = 'js/StompJms.js';
document.head.appendChild(imported);//报错:document 未定义。
因为js多线程web worker创建的子线程中不能对DOM进行操作,所以普通的js引用js并不能用。
document.write("...");//报错:document 未定义。
var imported = document.createElement('script');
imported.src = 'js/StompJms.js';
document.head.appendChild(imported);//报错:document 未定义。