我正在尝试打开一个新的html窗口并将其链接到外部css文件..
var myWindow = window.open("", "MsgWindow");
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", 'kamusi_ext-v1.css');
myWindow.document.head.appendChild(fileref);
但是我收到了这个错误:
script.js:70 Uncaught SecurityError:阻止具有原点“null”的帧访问具有原点“null”的帧。协议,域和端口必须匹配。
在Firefox上运行相同的脚本时,我没有收到此错误但css未被应用!