Hi All,
I hope everyone has had a pleasant, restful and blessed holiday.
May I pose a question regarding the Behavior layer with its intended effect on
presentation or structure? I'm looking for an answer according to best practice
and standards, as to which layer should we target to achieve a desired effect.
Scenario:
I have a div whose contents are only to be seen when scripting is not available
(I don't employ the noscript element). The div is given an id attribute and
value ("remove") acting as a hook to an external javascript function which
performs the intended behavior. So far, so good. The function can affect either
the style or the structure of the div and its contents. Both approaches work
equally well. My question is which is the preferred/correct layer to target
when we have a choice? The functions are exhibited below:
////////////////// - behavior affects the presentation layer
function remove1()
{
document.getElementById("remove").style.display = "none";
}
/////////////////
///////////////// - behavior affects the structure layer
function remove2()
{
var div = document.getElementById("remove");
div.parentNode.removeChild(div);
}
/////////////////
Am I correct in thinking that behavior should target structure first, and if
necessary, presentation second?
Kind regards,
Frank M. Palinkas
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************