GetDotted Domains

Viewing Thread:
"Another quick scripting question..."

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sun 30/03/03 at 14:44
Regular
Posts: 787
Hi,

Could someone tell me whether this short script will work in NS6+?
I've been trying to find out from various places but none of them says how NS6+ handles visibility and the changing of CSS attributes through the "style" part of the string.

Cheers

////

function showDiv(divToShow,hide1)
{
if (document.all)
{
document.all[hide1]. style.visibility="hidden"
document.all[divToShow]. style.visibility="visible"
}
else
if (document.getElementById())
{
document.getElementById(hide1). style.visibility="hidden"
document.getElementById(divToShow). style.visibility="visible"
}
}
Sun 30/03/03 at 18:01
Regular
"You've upset me"
Posts: 21,152
RastaBillySkank wrote:

> I've trawled the web in search of the answer to these questions but
> cannot find them. Anywhere. Dammit.

Hmmm. I now have answers courtesy of weird phrasing in Google.

What I've found is that NS6 supports getElementByID, sets visibility using visible/hidden and changes CSS attributes using .style.attribute=... this in theory means that the original script using getElementById should have worked in NS6, and the only reason I can think of it not working is because NS6 doesn't display background colours of the div, but gives the text within it a background colour, and because there was NO text in either div it would have given the effect of there being no change.

My solution is to add the layer-background-color property to the CSS declaration which is NS's way of adding a bg colour to the whole div and not just the text.

I have also concluded that I just don't care anymore and wish that for once corporations and businesses could agree on something instead of introducing rival products with different sodding ways of handling everything. Ergo: a single sodding browser.



I'm sure you either a) didn't read that or b) got confused by my meaningless rambling.
I don't care. I needed to rant.

*sigh*
Sun 30/03/03 at 17:55
Regular
"Eff, you see, kay?"
Posts: 14,156
RastaBillySkank wrote:
> Turbonutter wrote:
> Nope, nothing happens.
>
> Hmmm, that means it's either the difference of show/hide or the style
> part of the string. I'll test the show/hide then.
>
> What about now?

Still no worky.
Sun 30/03/03 at 17:47
Regular
"You've upset me"
Posts: 21,152
I've actually given up on trying to make it work in NS 4.7 after half a sodding hour conditonalising the whole sodding script.

So.

Now I just need three questions answered:

1)How does NS 6 set visibility: show/hide or visible/hidden?
2)What does NS 6 support: document.all, document.getElementById or neither?
3)How do you change CSS attributes in JavaScript in NS 6: something.style.attribute= or something.attribute=?

I've trawled the web in search of the answer to these questions but cannot find them. Anywhere. Dammit.
Sun 30/03/03 at 17:13
Regular
"Chavez, just hush.."
Posts: 11,080
Redrar
Greenrar
Redrar
Greenrar
Redrar
Greenrar
Redrar
Greenrar

Ok, it's getting boring now...

It works with IE6, you already knew that but you didn't know that it works with ~my~ IE 6...
Sun 30/03/03 at 16:51
Regular
"You've upset me"
Posts: 21,152
Turbonutter wrote:
> Nope, nothing happens.

Hmmm, that means it's either the difference of show/hide or the style part of the string. I'll test the show/hide then.

What about now?
Sun 30/03/03 at 16:07
Regular
"Eff, you see, kay?"
Posts: 14,156
Nope, nothing happens.
Sun 30/03/03 at 15:44
Regular
"You've upset me"
Posts: 21,152
Turbonutter wrote:
> Put it somewhere and I'll test it for you.

http://www.geocities.com/rbs2k2/nstest.html

If it works a green square should replace the black one.

Cheers Rob.
Sun 30/03/03 at 15:01
Regular
"Eff, you see, kay?"
Posts: 14,156
Put it somewhere and I'll test it for you.
Sun 30/03/03 at 14:44
Regular
"You've upset me"
Posts: 21,152
Hi,

Could someone tell me whether this short script will work in NS6+?
I've been trying to find out from various places but none of them says how NS6+ handles visibility and the changing of CSS attributes through the "style" part of the string.

Cheers

////

function showDiv(divToShow,hide1)
{
if (document.all)
{
document.all[hide1]. style.visibility="hidden"
document.all[divToShow]. style.visibility="visible"
}
else
if (document.getElementById())
{
document.getElementById(hide1). style.visibility="hidden"
document.getElementById(divToShow). style.visibility="visible"
}
}

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!
10/10
Over the years I've become very jaded after many bad experiences with customer services, you have bucked the trend. Polite and efficient from the Freeola team, well done to all involved.

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.