Estoy intentando crear una función de tema de página para mi sitio. Quiero cargar los temas correspondientes dinámicamente en la página usando archivos CSS separados.Cargando dinámicamente CSS
Estoy usando este código:
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", 'link.css')
document.getElementsByTagName("head")[0].appendChild(fileref)
que funciona muy bien, pero no devuelve ninguna información si el archivo CSS ha cargado o no.
¿Hay alguna manera de detectar cuando se carga el .css
? ¿Quizás usando ajax?
ver enlace útil aquí http://www.cssnewbie.com/simple-jquery-stylesheet-switcher/ –