Linked Questions

8 votes
8 answers
44k views

I am relatively novice to javascript. I have written a simple counter program that starts count down from 10 till it reaches 1. <script type="text/javascript"> function countDown(secs) { ...
v09's user avatar
  • 890
7 votes
3 answers
2k views

I am trying to show a div of information on a bar graph if the user hovers over the bar for a second. The answers on this site have gotten me to this point var timer; $(".session_hover").on({ '...
1 vote
3 answers
1k views

I was reading an answer on StackOverflow here that explained how to use setTimeout to create a sort of recurring loop on a webpage. However, I am wondering why setTimeout requires an anonymous ...
Charles's user avatar
  • 4,548
3 votes
2 answers
2k views

When I execute the following, incidentController gets called after 10 seconds and continues to execute with no problems every 10 seconds: // This works fine in nodejs v0.11.13 setInterval(...
2 votes
1 answer
2k views

There are two functions hello1() and hello2(). function hello1(){ console.log('hello1'); } function hello2(){ console.log('hello2'); } setTimeout(hello1, 3000); setTimeout(hello2(), 3000); ...
0 votes
2 answers
2k views

I am trying to call a function with setTimeout() inside another function and I keep getting this error: hi is not defined This is the code. hello("hi"); function hello(a) { hi(a); function ...
1 vote
2 answers
2k views

var test = function(a, b) { return a + b; }; setTimeout(test(2, 3), 3000); it shows some type error
-1 votes
1 answer
2k views

I want to pass a variable in a function inside setInterval, i'm tried with this code but doesn't work. Anyway function orologio(arg) append in a div a variable returned by other function orario_sisma ...
2 votes
3 answers
274 views

Possible Duplicate: How can I pass a parameter to a setTimeout() callback? Is there ever a good reason to pass a string to setTimeout? I want to call a function loadPHPQuote(code) after 1 second....
-2 votes
2 answers
793 views

if i write like so, things work var p1Button = document.getElementById("p1Button"); var p1Score = 0; var p1Span = document.getElementById("p1ScoreSpan"); var p2Button = document.getElementById("...
OK999's user avatar
  • 1,429
2 votes
3 answers
406 views

I'm trying to use setTimeout inside a function in which I provide the callback and the delay. I can't seem to get this to work. Here's my code: const timeout = function(cb, ms, msg) { setTimeout(cb(...
GTA.sprx's user avatar
  • 827
0 votes
2 answers
205 views

Example of setTimeout being executed after a synchronous code is below it console.log('hello'); setTimeout(() => console.log('timeout'), 0); console.log('end'); Console Output: hello end ...
1 vote
2 answers
360 views

I have the following code: for (z=0;z<7;z++) { x = Math.floor((Math.random() * 7)); //I am pulling some class names from an array here var element = document.querySelector("." + map[x]); //...
HappyCoder's user avatar
  • 6,193
0 votes
3 answers
204 views

I have this function: function executeCommand(callback) { let params = {screen_name: '...'}; client.get('/statuses/user_timeline', params, function(error, tweets) { if (JSON.parse(...
Anton's user avatar
  • 199
-1 votes
2 answers
656 views

I'm sorry. I don't know how to describe this problem carefully.so I hope put my code first. var test = 'less'; function test_I(tite) { console.log(tite); } var repeat = "test_I('"+test+"')"; ...
ice cold's user avatar

15 30 50 per page
1
2 3 4 5
...
8