Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: My doubts

  1. #11
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Quote Originally Posted by Twey
    A simple clock script would be
    Simple? Ouch, I can't even understand how that works. Well, I do, but it just seems really complex. I would prefer to write out the variables for time...
    Code:
    var date = new Date()
    var hours = date.getHours()
    var minutes = date.getMinutes()
    And then display them simply by assigning innerHTML, or innerText (doesn't work in Firefox) a value.
    Just my opinion though

    Oh, and btw, what does "!==" mean?
    - Mike

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I would prefer to write out the variables for time...
    There's no point creating variables if you're only going to use them once
    And then display them simply by assigning innerHTML, or innerText (doesn't work in Firefox) a value.
    innerHTML is non-standard and ugly. innerText is IE-only.
    Oh, and btw, what does "!==" mean?
    Opposite of ===: non-type-casting comparison. It's slightly more efficient than its more lax companion ==, so should be used where possible.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your answer.
    Anyway, the time display works! Thanks a lot.

    What I mean by "best" is that,
    which Internet browser that supports most of the codes, or is it all the same?

  4. #14
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oh ya.. erm. JavaScripts.. they seems more complicating than CSS to beginners like me.

    that's the application of "DHTML" that i'm refering to

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
  •