...

View Full Version : Can a javascript generated dialogue be enclosed in a table?



hereami
06-06-2003, 05:00 PM
Can a javascript generated dialogue be enclosed in a table?
Hello to all,

I have inserted the "Display time of last visit" script into my web page.
The problem:
The generated dialogue appears (barely) in black type. My page background is also black.
Can I enclose the scipt in a table with a white/other coloured cell?

All assistance will be appreciated. Thanks in anticipation. Dante

Dialogue generator:

<script>
if (Count()==1){
document.write("This is your 1st visit to our page")
When()
}
else if (Count()>1)
document.write("Welcome back. Your last visit was on <b>" + When() +"</B>.")
</script>

Roy Sinclair
06-06-2003, 05:25 PM
Use ordinary html to style the text:

<span style="color: white; font-size: larger;">
<script>
if (Count()==1){
document.write("This is your 1st visit to our page")
When()
}
else if (Count()>1)
document.write("Welcome back. Your last visit was on <b>" + When() +"</B>.")
</script>
</span>


Whatever is written by the script will be styled accoding to the surrounding html code.

hereami
06-06-2003, 06:38 PM
Thanks, Roy,

I will code that in tonight.

May I pick your brains further?

I am wondering if it is then possible to make the "Welcome" dialogue go away after a time lapse of approx. 20-30 seconds.

And, if so, will it cause search engines and/or spiders to baulk at scanning my site?

Regards, Dante

brothercake
06-06-2003, 07:35 PM
It won't make any difference because robots don't read javascript.

Roy Sinclair
06-06-2003, 08:31 PM
<span id="shortSpan" style="color: white; font-size: larger;">
<script>
if (Count()==1){
document.write("This is your 1st visit to our page")
When()
}
else if (Count()>1)
document.write("Welcome back. Your last visit was on <b>" + When() +"</B>.");
setTimeout("document.getElementById('shortSpan').style.visibility='hidden'",30000);
</script>
</span>


This should make it disappear after 30 seconds.

hereami
06-06-2003, 08:42 PM
Thanks again, Roy,

The first part that you gave me, is working well. Now to include the time element.

I am hoping that this coding will serve as a small hook to visitor interest, inclining them to read further.

Your help is much appreciated. I could get hooked on learning JavScript.

Hoping that you have a good weekend.

Cheers, Dante



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum