Evertjan.
11/1/2014 9:13:00 AM
Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> wrote on 31 okt 2014
in comp.lang.javascript:
> In comp.lang.javascript message <XnsA3D667E8B5370eejj99@194.109.133.133>
> , Thu, 30 Oct 2014 10:12:52, Evertjan. <exxjxw.hannivoort@inter.nl.net>
> posted:
>
>>Dr J R Stockton <reply1400@merlyn.demon.co.uk.invalid> wrote on 29 okt
2014
>>in comp.lang.javascript:
>>
>>> What happens if you put something *like*
>>>
>>> <body style="display:none;"
>>> onload='document.body.style="display:block;"'>
>>
>>wrong syntax,
>
> that is why I wrote "something like". I wished to convey the idea,
> without having time to test it.
Indeed, nontheless the "why" does not diminish the fact that it was
syntactically wrong and so a wrong idea.
element.style is a CSSstyleDeclaration object,
needing a specific style element as a key/index
and is read/write:
<body style="display:none;"
onload='alert(document.body.style["display"])'>
will return 'none'.
and so cannot be used for entering stylesheet strings,
as a stylesheet is not a style.
=====================
<body style="display:none;"
onload='document.body.style.display="block"'>
works fine here, however:
<body style="display:none;"
onload='this.style.display="block"'>
cannot be used, why is that?
cann't we use "this" in a onload?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)