Tengo el código siguiente para insertar un estilo en DOM (hay un caso de uso para inyectar estilo en DOM así que no preguntes por qué ni diga cargar el CSS en el archivo .css).Error de Chrome con NO_MODIFICATION_ALLOWED_ERR Dom Exception 7
<script type="text/javascript">
window.onload = function()
{
var bmstyle = document.createElement('style');
bmstyle.setAttribute('type', 'text/css');
var styleStr = "#test-div {background:#FFF;border:2px solid #315300;";
bmstyle.innerHTML = styleStr;
document.body.appendChild(bmstyle);
}
</script>
Si ejecuto en Firefox, funciona bien. Pero tengo este error en Google Chrome:
Line bmstyle.innerHTML = styleStr;
Uncaught Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
¿Alguien tiene una solución? Gracias
parece mi problema que se describe aquí http://code.google.com/p/chromium/issues/detail?id=3976#makechanges~~V~~singular~~3rd así que me pregunto si "¿hay una forma de trabajar? " Gracias –