Re: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread Chris Knowles
Frank Palinkas wrote:

 
 Am I correct in thinking that behavior should target structure first, and if 
 necessary, presentation second?
 

Frank,

when you have a choice I don't think it matters which one you choose.

But this raises another question I'd like to ask...take these situations:

a) the user agent has Javascript that doesn't support the DOM (but has
CSS enabled)
b) the user agent is Javascript enabled and not CSS enabled

how common is a) (maybe not on the desktop but what about other
devices?) and does b) actually exist out there?

If so, then I'm not sure there's ever really a choice. e.g. in your
example you would need to use both methods to cover a) and b):
a) would need you to set the style to display: none
and b) would need you to try and remove the node

-- 
Chris Knowles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



RE: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread Frank Palinkas
Hi Chris,

Thanks for the reply. As you illustrate, trying to be definitive in this 
situation seems pretty much impossible. It's appreciated.

Kind regards,

Frank


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Knowles
Sent: Monday, 07 January, 2008 9:54 AM
To: wsg@webstandardsgroup.org
Subject: Re: [WSG] Behavior Effecting Presentation or Structure - Precedence?

Frank Palinkas wrote:


 Am I correct in thinking that behavior should target structure first, and if 
 necessary, presentation second?


Frank,

when you have a choice I don't think it matters which one you choose.

But this raises another question I'd like to ask...take these situations:

a) the user agent has Javascript that doesn't support the DOM (but has
CSS enabled)
b) the user agent is Javascript enabled and not CSS enabled

how common is a) (maybe not on the desktop but what about other
devices?) and does b) actually exist out there?

If so, then I'm not sure there's ever really a choice. e.g. in your
example you would need to use both methods to cover a) and b):
a) would need you to set the style to display: none
and b) would need you to try and remove the node

--
Chris Knowles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread kevin mcmonagle

This is way above me but isn't that what the below method does?

http://www.bobbyvandersluis.com/ufo/

if so how does he do it?
it seems to be the savy solution



hope my reply is relevant

-kevin



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



RE: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread Frank Palinkas
Hi Kevin, and thanks. I think I've found a simpler way to handle this. Please 
see my next reply to Chris Knowles.

Kind regards,

Frank


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of kevin mcmonagle
Sent: Monday, 07 January, 2008 10:57 AM
To: wsg@webstandardsgroup.org
Subject: Re: [WSG] Behavior Effecting Presentation or Structure - Precedence?

This is way above me but isn't that what the below method does?

http://www.bobbyvandersluis.com/ufo/

if so how does he do it?
it seems to be the savy solution



hope my reply is relevant

-kevin



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



RE: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread Frank Palinkas
Hi Chris,

(My apologies to the list moderators if this is getting to Behavior orientated.)

 If so, then I'm not sure there's ever really a choice. e.g. in your
 example you would need to use both methods to cover a) and b):
 a) would need you to set the style to display: none
 and b) would need you to try and remove the node

I don't know if this will satisfy the conditions you raised, but combining the 
two methods with an if else statement may make sense:

/*

function remove()
{
if (remove)
{
var div = document.getElementById(remove);
div.parentNode.removeChild(div);
}
else
{
document.getElementById(remove).style.display = none;
}
}

*/

Kind regards,

Frank


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread Chris Knowles
Frank Palinkas wrote:

 function remove()
 {
 if (remove)
 {
 var div = document.getElementById(remove);
 div.parentNode.removeChild(div);
 }
 else
 {
 document.getElementById(remove).style.display = none;
 }
 }
 
Frank,

try this...

if (typeof document.removeChild != undefined) {
var div = document.getElementById(remove);
div.parentNode.removeChild(div);
} else {
document.getElementById(remove).style.display = none;
}

if you're doing a lot of checking throughout your code though set a
global flag...

var DOM = document.getElementById ? true : false;

and then...

if (DOM) {
...
}

email me direct if you want to discuss as it's probably off topic by now.

-- 
Chris Knowles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



RE: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread Frank Palinkas
Brilliant! Thank you Chris.


Frank,

try this...

if (typeof document.removeChild != undefined) {
var div = document.getElementById(remove);
div.parentNode.removeChild(div);
} else {
document.getElementById(remove).style.display = none;
}

if you're doing a lot of checking throughout your code though set a
global flag...

var DOM = document.getElementById ? true : false;

and then...

if (DOM) {
...
}

email me direct if you want to discuss as it's probably off topic by now.

--
Chris Knowles


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***



Re: [WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-07 Thread Gitanjali
Heloo

Can any boy help out wid this problem.

the problem is when my dropdown menu r any frams r over the combobos, det
frams r visible under the combobox..

please give me d solution for dis ASAp

Thank u..

On Jan 7, 2008 5:37 PM, Frank Palinkas [EMAIL PROTECTED] wrote:

 Brilliant! Thank you Chris.


 Frank,

 try this...

 if (typeof document.removeChild != undefined) {
var div = document.getElementById(remove);
div.parentNode.removeChild(div);
 } else {
document.getElementById(remove).style.display = none;
 }

 if you're doing a lot of checking throughout your code though set a
 global flag...

 var DOM = document.getElementById ? true : false;

 and then...

 if (DOM) {
...
 }

 email me direct if you want to discuss as it's probably off topic by now.

 --
 Chris Knowles


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: [EMAIL PROTECTED]
 ***




***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
***

[WSG] Behavior Effecting Presentation or Structure - Precedence?

2008-01-06 Thread Frank Palinkas
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]
***