Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Location
    S.E. UK
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can a javascript generated dialogue be enclosed in a table?

    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>

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    New to the CF scene
    Join Date
    Jun 2003
    Location
    S.E. UK
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Scripts inside HTML

    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

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It won't make any difference because robots don't read javascript.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <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.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #6
    New to the CF scene
    Join Date
    Jun 2003
    Location
    S.E. UK
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank you for your assistance

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •