Am wondering how it would be possible to unload a CSS from a page. e.g. In my page I have included a file called a.css. Now I want the user to be able to change the theme, which is CSS driven, thus he/she should be able to unload a.css and then I can load b.css (else they will conflict)
Any idea how to go about this?
css']"). remove(); Obviously, replace fileToRemove. css with the relative path and filename of the file to be unloaded.
Open up the webpage and click File-> Save Page As... and from that prompt select "Web Page, Complete" . Once you've saved this page this downloads a complete version of the html, javascript, css files and images that are referenced in the HTML.
Take the link element and disable it
document.getElementsByTagName('link')[0].disabled = true;
With jquery, this works:
$("link[href='fileToRemove.css']").remove();
Obviously, replace fileToRemove.css with the relative path and filename of the file to be unloaded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With