This is more of a post to inform, unless of course I am missing
something fundamental, in which case I would appreciate anyone
explaining it.
Based on Mr. Michaux's camelizeStyle function I wrote:
function create_style(style)
{
var p = document.createElement('p');
var t = document.createTextNode('Just something to fill the P.');
p.appendChild(t);
for (var i in style)
{
p.style[camel_style(i)] = style[i];
}
getTags('body')[0].appendChild(p);
}
getTags is simply a wrapper for getElementsByTagName.
Now... I happened to notice that in Internet Explorer 6 (Windows XP
SP2), if I called create_style({ 'background-color': '#00f' }) within
the document BODY, Internet Explorer firstly shows me my newly created
P, styles and all, and THEN issues a message box (like an alert) saying:
***
Internet Explorer cannot open the Internet site
file://test_create_style.htm.
Operation aborted
[ OK ]
***
Why does it abort? I am assuming because it was not in a DOM-ready state.
Why does it show me the newly created P, styles and all? I am assuming
because Internet Explorer mostly does what it wants to.
Anyway, the same function performs wonderfully in the onload event.
Declared as window.onload or as an inline event to the BODY.
--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.