H
hobosalesman
Somehow font elements are being added everywhere in my page, with size
set to 4. Maybe I'm just tired but I have no idea what's going on, even
weirder considering the page is XHTML 1.0 strict served with the proper
MIME type... heres some code:
var divs = document.getElementsByTagName("div");
for (var i=0; i<divs.length; i++) {
if (divs.className == "cwindow") {
windows.push( [ divs.title, document.body.removeChild(divs)]
);
i--;
}
}
for (var i=0; i<windows.length; i++) {
bodytext += "<div class='window_border'><div class='window_wrap'><div
class='window_header'><div class='window_header_content'>";
//Title
bodytext += windows[0];
bodytext += "</div></div><div class='window_body_border'><div
class='window_body' style='background-position:" +(
Math.round(Math.random()*800) )+ "px " +( Math.round(Math.random()*800)
)+ "px;'>";
//Body
bodytext += windows[1].innerHTML;
bodytext += "</div></div></div></div>";
}
Wherever I add the title and body from 'windows' it puts it inside a
font element with size of 4. Text is huge. It also adds it in other
places in the middle of a string asigned with innerHTML. I don't get it
and I'm giving up for sleep now, please point out my simple stupid
mistake.
HS
set to 4. Maybe I'm just tired but I have no idea what's going on, even
weirder considering the page is XHTML 1.0 strict served with the proper
MIME type... heres some code:
var divs = document.getElementsByTagName("div");
for (var i=0; i<divs.length; i++) {
if (divs.className == "cwindow") {
windows.push( [ divs.title, document.body.removeChild(divs)]
);
i--;
}
}
for (var i=0; i<windows.length; i++) {
bodytext += "<div class='window_border'><div class='window_wrap'><div
class='window_header'><div class='window_header_content'>";
//Title
bodytext += windows[0];
bodytext += "</div></div><div class='window_body_border'><div
class='window_body' style='background-position:" +(
Math.round(Math.random()*800) )+ "px " +( Math.round(Math.random()*800)
)+ "px;'>";
//Body
bodytext += windows[1].innerHTML;
bodytext += "</div></div></div></div>";
}
Wherever I add the title and body from 'windows' it puts it inside a
font element with size of 4. Text is huge. It also adds it in other
places in the middle of a string asigned with innerHTML. I don't get it
and I'm giving up for sleep now, please point out my simple stupid
mistake.
HS