JS dynamic loading of CSS in the theme of the interface has a very important significance, users can choose their own browsing habits to select their favorite page display, the following detailed description.
I hope the following methods are helpful to you.
(1) Dynamically loading JS files using JavaScript
/*javascript dynamically loaded JS file
/var scriptnode = document.createelement (' script ');
SCRIPTNODE.SRC = ' proxy.js?t= ' +new Date (). GetTime ()/* With time parameters to prevent cache
/Document.head.appendChild (Scriptnode);
(2) Dynamically loading CSS files using JavaScript
/*javascript dynamically load CSS file
/var cssnode = document.createelement (' link ');
Cssnode.rel = ' stylesheet ';
Cssnode.type = ' text/css ';
Cssnode.media = ' screen ';
Cssnode.href = ' style.css?t= ' +new Date (). GetTime ()/* With time parameters to prevent caching/
The above is the use of JavaScript dynamic loading of JS files and CSS file methods, I hope to help you learn.