Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #32537
| From | Jake Jarvis <pig_in_shoes@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: setInterval |
| Date | 2017-02-07 11:13 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <o7c6hh$fgc$1@dont-email.me> (permalink) |
| References | (12 earlier) <c8d749e4-8813-498c-a763-bc345854732d@googlegroups.com> <o7blfb$vpl$1@dont-email.me> <d34fec64-6d04-406d-af29-d87a6a801558@googlegroups.com> <e9e8ab21-38ef-4741-971e-403a492bf733@googlegroups.com> <4dcf7316-29b0-4506-a14c-48c4ed827c18@googlegroups.com> |
Am 07.02.2017 um 07:45 schrieb jonas.thornvall@gmail.com:
> Den tisdag 7 februari 2017 kl. 07:27:43 UTC+1 skrev Julio Di Egidio:
>> On Tuesday, February 7, 2017 at 7:09:59 AM UTC+1, jonas.t...@gmail.com wrote:
>>> Den tisdag 7 februari 2017 kl. 06:22:34 UTC+1 skrev Julio Di Egidio:
>> <snip>
>>> Well i solved it, but i really hate when i can't ***understand*** the
>>> difference, but one approach work.
>>
>> Have you tried *studying* the language? I have given few essential pointers.
>>
>>> So i would be glad if someone can tell why this is correct and work, while
>>> all other *equivalent*? fails miserable.
>>
>> Because they were not equivalent... One thing I notice is that in this one you
>> are using setInterval, not setTimeout, and you just happen to have put together
>> some working scheme.
>>
>> Something I can tell you for sure is that you'll be banging your head on the
>> table for as long as your approach to programming is that of the trial and
>> error...
>>
>> Best luck and have fun,
>>
>> Julio
>>
>>> function INTRO(){
>>> mycount=25;
>>> document.NoLinks.linkval.value=mycount;
>>> document.getElementById('mysubset').selectedIndex=1;
>>> bananas=setInterval(function(){monkeybuisness();}, 200);
>>> }
>>>
>>> function monkeybuisness() {
>>> mycount--;
>>> document.NoLinks.linkval.value=mycount;
>>> AUTOGRAPH();
>>> if(mycount<1){clearInterval(bananas);document.getElementById('mysubset').selectedIndex=0;}
>>> }
>
> Well if you know their not equvalent, why are they not equvalen, i see this one use
> bananas=setInterval(function(){monkeybuisness();}, 200);
>
> what differ when execute upper from lower example
>
> bananas=setInterval(monkeybuisness();, 200);
>
> Because i would think that the lower syntax is the straightforward to do what the upper actually, do just do not understand.
>
> So please explain to me.
> 1. What does the lower one actually do, because it simply not working.
> 2. What the fuck does the upper syntax mean, it is none sensical?
> function(){monkeybuisness();}, 200???????????? What kind of fucking syntax is this, and where did ECMASCRIPT/JAVASCRIPT found the idea behind, because there must be one right? I do not feel comfortable just throwing in things that i can not see the purpose with. So please for god sake can someone explain what the syntax is about, or should i just except it is totally fucking nonesensible?
>
> You see for me the syntax could as well be to settimeout
> setInterval(afewbananas(){monkeybuisness();}, 200)
> And you see monkeybuisness i have no problem with alot of what i do is that.
> But one wonder why should i always stick a few bananas into the monkey buisness. I know what monkey buisness do but i am fucking clueless to the mysteries of a few bananas.
>
> Ok rant finished, but if someone know the answer to a few bananas, don't hesitate to tell me.
>
You can do a couple of things with functions in this language:
- you can call them
- you could give it to someone else, so they call it (remember
the FileReader?)
Do you understand that?
// calling
monkeybusiness();
vs.
/*
giving setTimeout a handle on the function, setTimeout will arrange the
calling ... after the timeout
*/
window.setTimeout(monkeybusiness, 1000);
But also please understand how functions can be defined in this language.
/*
giving setTimeout a handle on an anonymous function that calls
monkeybusiness, setTimeout will arrange the calling
*/
window.setTimeout(function(){monkeybusiness();}, 1000);
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
setInterval jonas.thornvall@gmail.com - 2017-02-05 23:26 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-05 23:30 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 00:17 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 00:24 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 00:36 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 01:10 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 01:20 -0800
Re: setInterval Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-02-06 14:10 +0000
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 11:25 -0800
Re: setInterval Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-02-06 21:12 +0000
Re: setInterval Silvio <silvio@internet.com> - 2017-02-06 22:15 +0100
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 14:17 -0800
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:50 +0100
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 20:57 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 21:15 -0800
Re: setInterval "Julio P. Di Egidio" <julio@diegidio.name> - 2017-02-07 06:22 +0100
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 22:09 -0800
Re: setInterval Julio Di Egidio <julio@diegidio.name> - 2017-02-06 22:27 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 22:45 -0800
Re: setInterval Jake Jarvis <pig_in_shoes@yahoo.com> - 2017-02-07 11:13 +0100
Re: setInterval Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-07 17:23 +0100
Re: setInterval Julio Di Egidio <julio@diegidio.name> - 2017-02-07 11:54 -0800
Re: setInterval Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-07 21:54 +0100
Re: setInterval Julio Di Egidio <julio@diegidio.name> - 2017-02-07 13:50 -0800
Re: setInterval Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-07 23:19 +0100
Re: setInterval Julio Di Egidio <julio@diegidio.name> - 2017-02-07 15:33 -0800
Re: setInterval Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-09 00:23 +0100
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-07 11:33 +0100
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:28 +0100
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:26 +0100
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:24 +0100
Re: setInterval Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-07 04:36 +0100
Re: setInterval Silvio <silvio@internet.com> - 2017-02-06 16:13 +0100
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 12:10 -0800
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 12:27 -0800
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:16 +0100
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 14:28 -0800
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:45 +0100
Re: setInterval Tim Streater <timstreater@greenbee.net> - 2017-02-06 21:25 +0000
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:19 +0100
Re: setInterval JJ <jj4public@vfemail.net> - 2017-02-06 20:07 +0700
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 16:00 +0100
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 11:06 -0800
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:08 +0100
Re: setInterval jonas.thornvall@gmail.com - 2017-02-06 14:26 -0800
Re: setInterval "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:41 +0100
csiph-web