[Javascript] RES: (no subject)

SosCpdGMail soscpd at gmail.com
Tue Aug 28 18:04:01 CDT 2007


Oooops... Here come again with the missed necessary step:


This may help you somehow:

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);


function show_the_damn_object(element)
{
    if(!ns && !ie && !w3) return;
    if(ie) object=eval('document.all.'+element+'.style');
    else if(ns) object=eval('document.layers["'+element+'"]');
    else if(w3) object=eval('document.getElementById("'+element+'").style');
    /*and then, out of nowhere*/
    if (ie||w3)
    object.visibility="visible";
    else
    object.visibility ="show";
}

My only question is: it is damn or danm?


-----Mensagem original-----
De: javascript-bounces at lists.evolt.org
[mailto:javascript-bounces at lists.evolt.org] Em nome de John Pillion
Enviada em: terça-feira, 28 de agosto de 2007 18:37
Para: JavaScript List
Assunto: Re: [Javascript] (no subject)

thanks for the tips everyone, I got it working via the DOM, as suggested.

another question.  Are there any issues with IE7 and style.visibility?  
the following line works fine in firefox, but has no effect in IE.  I 
say "has no effect" as using an alert() before and after shows that the 
property *is* being changed, though IE7 does not  reflect the change.  
I'm not near a computer with IE previous to 7, so I can't test it there.

document.getElementById('statusLayer').style.visibility = "visible";

Thanks in advance!




Hassan Schroeder wrote:
> lists at jdpill.com wrote:
>
>   
>> That being the case, if I want to insert two rows into the table, using
>> javascript, how could I do that within the bounds of valid HTML? One of
>> two code options is inserted by the js - one option having one row, the
>> second having two...? by inserting two rows (which will have rows before
>> and after), I'm going to have to have the div overlapping the cells and
>> rows at some point?
>>     
>
> The point is you shouldn't be using a DIV here at all; it doesn't
> belong in a table.
>
> Either insert your innerHTML into a TR, or insert an entire row
> into a TBODY, which is probably better if you have a situation of
> possible multiple row insertions.
>
> Or add it via DOM and skip the innerHTML entirely... :-)
>
>   

_______________________________________________
Javascript mailing list
Javascript at lists.evolt.org
http://lists.evolt.org/mailman/listinfo/javascript




More information about the Javascript mailing list