show layer onload

B

BGT

Hi

I have some layers, at the same position.
I want to show one of them according to the system language,
and I have made this so far:

function showit() {
if (lang == "da") document.da.visibility="show"
if (lang == "de") document.de.visibility="show"
if (lang == "it") document.it.visibility="show"
if (lang == "fr") document.fr.visibility="show"
.................

<div class="box" id="da" style="visibility: hidden; position:
absolute; top: 1500px; align: center;">
<div class="box" id="de" style="visibility: hidden; position:
absolute; top: 1500px; align: center;">
..... and so on .......

body onload showit()

But it get: 'document.da' is null or not an object

What do I do wrong ?
 
R

Randy Webb

BGT said:
Hi

I have some layers, at the same position.
I want to show one of them according to the system language,

How are you determining system language?
and I have made this so far:

function showit() {
if (lang == "da") document.da.visibility="show"
if (lang == "de") document.de.visibility="show"
if (lang == "it") document.it.visibility="show"
if (lang == "fr") document.fr.visibility="show"
.................



document.getElementById('da').style.visibility = "visible";
And, where is lang defined?
<div class="box" id="da" style="visibility: hidden; position:
absolute; top: 1500px; align: center;">
<div class="box" id="de" style="visibility: hidden; position:
absolute; top: 1500px; align: center;">
..... and so on .......

If your visitors have JS disabled, they will see nothing. This whole
project is better suited to be done on the server, or, to have static
links on an intro page to each language page.
body onload showit()

But it get: 'document.da' is null or not an object

What browser?
 
R

Richard

Then why are we here discussing javascript at all if a very small percentage
of users have it turned off?

Have we not heard of "MAJORITY RULES"?
I've seen a vast majority of sites using some form of JS.

If you were to go to the country of Greece, you would expect everyone there
to know and understand English.

Why can't you just assist someone without the negativism all the time?
 
B

BGT

How are you determining system language?
that is no problem, works perfect on all other pages.
document.getElementById('da').style.visibility = "visible";
And, where is lang defined?
lang is defined in another extern script.
If your visitors have JS disabled, they will see nothing. This whole
project is better suited to be done on the server, or, to have static
links on an intro page to each language page.
Less than 1% of my visitors has js disabled,
if js was a problem this group would probably not exist :)
What browser?
IE6
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top