javascriptimportcss實例代碼_javascript技巧
來源:懂視網
責編:小采
時間:2020-11-27 20:39:36
javascriptimportcss實例代碼_javascript技巧
javascriptimportcss實例代碼_javascript技巧:一開始少寫了個分號(紅色的),怎么搞都不對. var style = document.createElement(STYLE); document.body.appendChild(style); style.onerror = function(){ alert(here1) } style.onreadystatec
導讀javascriptimportcss實例代碼_javascript技巧:一開始少寫了個分號(紅色的),怎么搞都不對. var style = document.createElement(STYLE); document.body.appendChild(style); style.onerror = function(){ alert(here1) } style.onreadystatec

一開始少寫了個分號(紅色的),怎么搞都不對.
var style = document.createElement("STYLE");
document.body.appendChild(style);
style.onerror = function(){
alert("here1")
}
style.onreadystatechange = function(){
alert("here2");
}
var sheet = style.styleSheet || style.sheet;
if(sheet.addImport)
sheet.addImport("aa.css");
else
sheet.insertRule("@import url('aa.css');",sheet.cssRules.length);
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
javascriptimportcss實例代碼_javascript技巧
javascriptimportcss實例代碼_javascript技巧:一開始少寫了個分號(紅色的),怎么搞都不對. var style = document.createElement(STYLE); document.body.appendChild(style); style.onerror = function(){ alert(here1) } style.onreadystatec