Christmas is here! Christmas is here! Christmas is here!



  • So a little background to how I stumbled upon this WTFry: this past weekdend my wife and I were down in Charleston, SC for our anniversary, and we found this diner that happened to have art for sale from various local artists. One of the artists inspired us so much that we decided to buy some of his work when we got home. Today I went to go the artist's site to inquire about shipping, and I accidentally went to the wrong website. The website that I meant to go to uses the word "factories", and the one that I went to used "factory". When I went to the "factory" site I was surprised to be greeted by a Javascript alert box that said, "Christmas is here!" (It, of course, being the middle of August). Digging through their source code, I found these two wonderful WTF functions that I just had to share:

    function formatresults(){
    if (this.timesup==false){//if target date/time not yet met
    var displaystring=arguments[0]+" days "+arguments[1]+" hours "+arguments[2]+" minutes "+arguments[3]+" seconds left until March 23, 2009 18:25:00"
    }
    else{ //else if target date/time met
    var displaystring="Future date is here!"
    }
    return displaystring
    }
    
    function formatresults2(){
    if (this.timesup==false){ //if target date/time not yet met
    var displaystring=""+arguments[0]+" days "+arguments[1]+" hrs. "+arguments[2]+" min. "+arguments[3]+" sec."
    }
    else{ //else if target date/time met
    var displaystring="" //Don't display any text
    alert("Christmas is here!") //Instead, perform a custom alert
    }
    return displaystring
    }

    Btw, the website in question is [url=http://www.protonfactory.com]www.protonfactory.com[/url]. While the alert - which occurs on every page is a huge WTF - their content is pretty awesome (assuming you like art). :)



  • @Dynamic Countdown script- © Dynamic Drive (http://www.dynamicdrive.com) said:

    cdtime.prototype.updateTime=function(){
    var thisobj=this
    this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
    setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
    }

    ... I guess someone hasn't heard about setInterval. Edit: Also, WTF?



  • @dohpaz42 said:

    ==false

    That really annoys me for some reason.

     

     


  • ♿ (Parody)

    @hoodaticus said:

    @dohpaz42 said:
    ==false

    That really annoys me for some reason.

    Do you mean that idiom in general, or in this case? I don't know enough js, etc, to know if this is a specific WTF, but I find myself doing that sort of thing a lot, if only because it's harder to miss than a single preceeding !.


  • 🚽 Regular

    @hoodaticus said:

    @dohpaz42 said:

    ==false

    That really annoys me for some reason.

     

    Yeah, everyone should know it should be

    === false


Log in to reply