use : in ids, - isn't authorized as first character. use firstChild instead of childNodes[0]

This commit is contained in:
cloudhead
2010-06-15 01:17:35 -04:00
parent 3ee89922fc
commit c008f71db2

View File

@@ -107,7 +107,7 @@ function createCSS(styles, sheet, lastModified) {
// If there is no title set, use the filename, minus the extension
title = sheet.title || sheet.href.match(/(?:^|\/)([-\w]+)\.[a-z]+$/i)[1];
id = '-less-' + title;
id = 'less:' + title;
// If the stylesheet doesn't exist, create a new node
if ((css = document.getElementById(id)) === null) {
@@ -255,7 +255,7 @@ function error(e, href) {
if (less.env == 'development') {
timer = setInterval(function () {
if (document.body) {
document.body.insertBefore(elem, document.body.childNodes[0]);
document.body.insertBefore(elem, document.body.firstChild);
clearInterval(timer);
}
}, 10);