Access CSS file contents via JavaScript

后端 未结 6 767
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 04:29

Is it possible to get the entire text content of a CSS file in a document? F.ex:




        
6条回答
  •  天命终不由人
    2020-11-30 05:33

    I think your best bet would be to load it with ajax with something like:

    $.get("/path/to/file.css", function(cssContent){
        alert("My CSS = " + cssContent);
    });
    

提交回复
热议问题