39 users online (0 members and 39 guests)  


  Results 1 to 4 of 4

Related

  1. Any Idea why?    Forum: Myspace Forum
    Replies: 0
  2. New idea    Forum: Search Engine Optimization - SEO - Forum
    Replies: 2
  3. Is this a good idea?    Forum: Affiliate Marketing and Reseller Programs
    Replies: 4
  4. Good idea or no?    Forum: Show it off!
    Replies: 2
  1. #1
    wahid's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    75

    Question An ideal Script idea...for a newbie...

    Here is an idea I thought would I would like to see move from being an idea...

    A strange script if there ever was one, but could be used for many purposes, once it was available.

    1. It would reference a browsers time/date.

    2. At the appointed time it would show a page with a message, based on that time. (anything could be on that page).

    3. It would do and keep doing this for any duration/length of time, say one hour, two hours, (half or portions of hours are not necessary, but would be good as I would see the code logic...and learn from it)

    4. It w/could do this any amount of times per 24 hour period, which means that w/could be easily configurable for any amount of time and for any length/duration of that time...

    The idea is a browser would get the right and appropriate message, depending on his time zone....and only he would see that message...even though many browsers were indeed on the site/page at the time.

    Is that possible with javascript...?
    I have been learning some basic scripting from the help I get on this site, and have come to believe, that scripting is an excellent achievement, comparable with any high science...and the effects are magical...

    So will someone please tell me if my ideal script is achieveble by some high scientist with magical skills....LOL....?

    I saw script recently that I am remembering....that does a similar thing...or close.
    I think it tells good morning or good afternoon....that is the idea, except this ideal script would do it not twice, but a (x)number of times, and show a page as well, a different page for each time period sellected.

    Thanx for any response...
    Peace

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    The idea is a browser would get the right and appropriate message, depending on his time zone....and only he would see that message...even though many browsers were indeed on the site/page at the time.
    It seems like a good candidate for php. A JS can detect the users windows time and print it out, but I think for the server to take it and create would take php. Then using the php if and else statements create the proper text for the user time.

    Dave

  3. #3
    wahid's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    75

    Smile

    Hi Dave...
    You know I was hanging around right...Thanx.
    OK, here is what I think...
    It would have to be a client-side operation for each (call that newbie-think)browser to have his experience at the time of the script.

    You see the script on the site would have one single set of code...(dunno if I said that properly), which would be interpreted by the browser depending on his time zone...hmmm

    Not sure I said that right either.
    OK I am still thinking....

    I am also trying to find the two scripts I saw...one is a javascript audio greeting, that says good morning, for example, and the other just prints the greeting...like good morning...

    I am actually doing that now, and hope to find them and post them in a little while....

    Do I still need PHP...You're making me nervous LOL...I just started javascripting and you mention rocket science....LOL...but I am sure you are right...it sounds logical....

    Thanx for your response...I am still thinking!
    Last edited by wahid; 11-09-2003 at 01:14 AM.

  4. #4
    wahid's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Oct 2003
    Posts
    75

    The scripts

    OK here are both scripts....
    Not sure how they would help, but it is a start...
    It sure helped to think about this script, or some may say dumb script...LOL.


    <!-- TWO STEPS TO INSTALL AUDIO GREETING:

    1. Copy the coding into the HEAD of your HTML document
    2. Create a separate file called "AudioGreeting.js" and put this code into it. -->

    <!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript" src="AudioGreeting.js">

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    <!-- Original: Happy Smart -->
    <!-- Web Site: http://happysmart.net -->
    </script>

    </HEAD>

    <!-- STEP TWO: Create a separate file called "AudioGreeting.js" and put this code into it. -->

    <BODY>

    var d = new Date()
    var h = d.getHours()

    //You can record your own audio greeting and customize the greeting time and message
    if (h < 12) document.write('<bgsound SRC="Goodmorning.wav" AUTOSTART=true LOOP=1>'+'Good morning!')
    else if (h < 17) document.write('<bgsound SRC="Goodafternoon.wav" AUTOSTART=true LOOP=1>'+'Good afternoon!')
    else if (h < 24) document.write('<bgsound SRC="Goodevening.wav" AUTOSTART=true LOOP=1>'+'Good evening!')


    <p><center>
    <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>

    <!-- Script Size: 1.18 KB -->
    END---------------------END


    Here is the other

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    datetoday = new Date();
    timenow=datetoday.getTime();
    datetoday.setTime(timenow);
    thehour = datetoday.getHours();
    if (thehour > 18) display = "Evening";
    else if (thehour >12) display = "Afternoon";
    else display = "Morning";
    var greeting = ("Good " + display + "!");
    document.write(greeting);
    // End -->
    </script>

    Thanx for any assistance possible...

    Peace



Tags for this Thread