Results 1 to 8 of 8

Thread: Second html / javascript question

  1. #1
    Senior Member flake's Avatar
    Join Date
    May 2001
    Posts
    800

    Second html / javascript question

    ok after your response to my last question (which I solved thanks to you lot) I have another.

    What I want to do is have some text that changes according to the time and/or date. For example say I wanted to set it so it said
    "It is 11 o clock" and at 12 it changes to
    "It is 12 o clock" etc...

    (lol, dont worry I'm not actually doing that, its to do with tournament times and dates, but I dont want to have to be constantly updating it manually)

    Can it be done?
    half the time I have no idea what you're talking about. the other half, I'm not listening.

  2. #2
    Senior Member Anthony's Avatar
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    12,020
    I typed "javascript clock" in google and this was the first hit ...

    http://www.javascript-page.com/clock.html
    Facebook - BW166 SQ585 BP405 DL660 CL310

  3. #3
    Senior Member flake's Avatar
    Join Date
    May 2001
    Posts
    800
    um, thats not really what I mean Ok I'll try a second example.

    Say at 10am some text says
    " Hello my name's bob, I'm having surgery later "

    and then at 1pm this changes to
    " Hello, my names lisa, I've just had surgery "

    and then at 6pm says
    " I have no weiner, god no, what have I done "

    make sense?
    half the time I have no idea what you're talking about. the other half, I'm not listening.

  4. #4
    MulletII - AKA Ninja Boner Gyno Rhino's Avatar
    Join Date
    Jun 2001
    Location
    FFFA Headquarters
    Posts
    11,468
    C'mon, dude, that should be easy to program yourself. Just find an existing proggy that captures time and use that as your base.
    Founding Member and CEO of the FFFA

    "All that matters is beauty on the inside! Outside beauty doesn't matter!"
    ~This is something ugly people say to feel better about themselves...

    "Strength and size don't matter! It's not fair to judge training knowledge based on strength and size!"
    ~This is something wussy people say to feel better about themselves...

    Pearls of Wisdom...


    Resident Ninja Demon (with a pet Radioactive Sloth) and SchlonkeyMaster of WBB!

    Rock is my 'Big Viking Brother', and not in a homo-esque way.

    And no COLON jokes, bastards!

  5. #5
    Senior Member Anthony's Avatar
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    12,020
    It's not exactly what you want, but the logic is there. Instead of showing the time update each second, you simply output the text you want based on an If condition. It can be done with javascript, asp, or php. Your choice.
    Facebook - BW166 SQ585 BP405 DL660 CL310

  6. #6
    Senior Member flake's Avatar
    Join Date
    May 2001
    Posts
    800
    hmmm, hadn't thought of it that way.

    * puts on thinking cap *
    half the time I have no idea what you're talking about. the other half, I'm not listening.

  7. #7
    Senior Member flake's Avatar
    Join Date
    May 2001
    Posts
    800
    ok sorry guys, I didn't realise quite how simple this was going to be, I was expecting mucho complications. my final script looks like this:

    -------------
    day = new Date()
    hr = day.getHours()
    hr1 = hr - 12

    if (hr < "1") {
    document.write(" text ")
    }
    -------------
    half the time I have no idea what you're talking about. the other half, I'm not listening.

  8. #8
    Senior Member Anthony's Avatar
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    12,020
    Good stuff.
    Facebook - BW166 SQ585 BP405 DL660 CL310

Bookmarks

Posting Permissions

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