Wait, how many seconds?



  • Found in a site I'm migrating to a supportable and functioning cms:

                <script type="text/javascript" >
                
                    function tensecondtimer(){
                        jQuery.ajax({
                           type: "POST",
                           cache: false,
                           url: "index.php/register/set_user_online/",
                           data: " "
                        });
                    }
                </script>
                <script type="text/javascript" >
                    tensecondtimer();
                    window.setInterval("tensecondtimer()",3000);
                </script>
    


  • Ten word reply

     Hahaha, nice!  Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very Very nice!



  •  Ugh, eval'd string in setInterval...



  •  Well, that's web 2.0 for you. Thank you for playing, better luck next time.



  • @bob171123 said:

    Well, that's web 2.0 for you. Thank you for playing, better luck next time.

    Ah, so this will be fixed in Web 3.0?  When will that be out?



  • The marketing droids are still suckling the teets of Web 2.0, and Web 3.0 will likely have some stupid moniker. In the end, the tensecondtimer() still beats it's little heart at 3 second intervals... until I tear it out and toss it in a dumpster, that is. ;)



  • @jchannell said:

    window.setInterval("tensecondtimer()",3000);
    The name relates to the server-side code that will assume you have logged out if you don't try and retrieve that URL within 10 seconds. The 3 second interval is used to ping the server within its 10 second timer to say "I'm still online!!!". The reason they use 3 seconds instead of 9.99 seconds is to allow for slow program execution, network latency, and fluctuations in the space-time continuum. A better name would of course be "inBeforeThe10SecondTimer", but it was deemed too verbose. The only problem is ... I'm not sure if I am being sarcastic or not...



  • @TarquinWJ said:

    @jchannell said:
    window.setInterval("tensecondtimer()",3000);
    The name relates to the server-side code that will assume you have logged out if you don't try and retrieve that URL within 10 seconds. The 3 second interval is used to ping the server within its 10 second timer to say "I'm still online!!!". The reason they use 3 seconds instead of 9.99 seconds is to allow for slow program execution, network latency, and fluctuations in the space-time continuum. A better name would of course be "inBeforeThe10SecondTimer", but it was deemed too verbose. The only problem is ... I'm not sure if I am being sarcastic or not...
    Yah, that's what I was thinking too. Or it was 10000 but then got changed and the name of the function didn't get updated.



  • @jchannell said:

    Web 3.0 will likely have some stupid moniker.
    I never thought about it, but it will likely have a name fluid-sounding and probably contain a name for a shade of blue.



  • @belgariontheking said:

    a name fluid-sounding and probably contain a name for a shade of blue.
     

    Smurve?



  • @dhromed said:

    @belgariontheking said:

    a name fluid-sounding and probably contain a name for a shade of blue.
     

    Smurve?

    Bluid.



  • @RogerWilco said:

    @TarquinWJ said:

    @jchannell said:
    window.setInterval("tensecondtimer()",3000);
    The name relates to the server-side code that will assume you have logged out if you don't try and retrieve that URL within 10 seconds. The 3 second interval is used to ping the server within its 10 second timer to say "I'm still online!!!". The reason they use 3 seconds instead of 9.99 seconds is to allow for slow program execution, network latency, and fluctuations in the space-time continuum. A better name would of course be "inBeforeThe10SecondTimer", but it was deemed too verbose. The only problem is ... I'm not sure if I am being sarcastic or not...
    Yah, that's what I was thinking too. Or it was 10000 but then got changed and the name of the function didn't get updated.

    It's still a terrible idea to hard-code implementation details in a function name.



  • It's obviously a timer that notifies the server that the user is in a tense condition and should be given a higher priority.



  • @julmu said:

    It's obviously a timer that notifies the server that the user is in a tense condition and should be given a higher priority.

    You win.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.