The way I see your scenario is that you are activating a div element which should be displayed when there is an absence of JavaScript, but you are trying to check "whether or not the JavaScript is enabled" by using JavaScript.
This is the same approach of cutting the same branch on which you are actually standing. Do let me know, if I have understood the problem as intended? If I have understood it in a wrong way, I take back all my words, if not then you should be checking the existence of JavaScript not by using JavaScript but by using some server based technology. Regards, Salman, Khwaja. On Mon, 07 Jan 2008 16:52:32 1100, [email protected] < [email protected]> wrote: > > ********************************************************************* > WEB STANDARDS GROUP MAIL LIST DIGEST > ********************************************************************* > > > From: Frank Palinkas <[EMAIL PROTECTED]> > Date: Mon, 7 Jan 2008 07:44:07 +0200 > Subject: Behavior Effecting Presentation or Structure - Precedence? > > 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 > des > ired effect. > > Scenario: > I have a div whose contents are only to be seen when scripting is not > avail > able (I don't employ the noscript element). The div is given an id > attribut > e and value ("remove") acting as a hook to an external javascript function > which performs the intended behavior. So far, so good. The function can > aff > ect either the style or the structure of the div and its contents. Both > app > roaches work equally well. My question is which is the preferred/correct > la > yer 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 > i > f necessary, presentation second? > > Kind regards, > > Frank M. Palinkas > > > ************************************************************** > Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm > Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm > Help: [EMAIL PROTECTED] > ************************************************************** > > > -- ------------------------- Salman, Khwaja. Snr. QA Engineer TPS Pakistan. Http://www.TPSOnline.com Quis Custodiet Ipsos Custodes ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *******************************************************************
