From f4936c622fe133a33fd4249b14cb5d68ce97e789 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 21 Mar 2016 21:52:18 +0300 Subject: [PATCH] Use inline style --- util.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util.js b/util.js index e3ac6b3..04cdcdf 100644 --- a/util.js +++ b/util.js @@ -332,7 +332,7 @@ window.curStyle = function(e) return window.getComputedStyle ? getComputedStyle(e) : e.currentStyle; }; -window.addCSS = function(url) +window.addStylesheet = function(url) { var s = document.createElement('link'); s.setAttribute('rel', 'stylesheet'); @@ -340,3 +340,11 @@ window.addCSS = function(url) s.setAttribute('href', url); document.getElementsByTagName('head')[0].appendChild(s); }; + +window.addCSS = function(css) +{ + var s = document.createElement('style'); + s.setAttribute('type', 'text/css'); + s.innerHTML = css; + document.getElementsByTagName('head')[0].appendChild(s); +};