setinterval

jQuery: delay interval of ajax function till previous run is completed

I've set up an AJAX page refresh with setInterval. From time to time, the server is so slow that a new request is initiated before the previous one has completed. How can I prevent that? ...

Viewing all the timouts/intervals in javascript?

I'm writing an application that utilizes Javascript timouts and intervals to update the page, is there a way to see how many intervals are setup? I want to make sure that I'm not accidentally going to kill the browser by having hundreds of intervals setup. is this even an issue? ...

setInterval/setTimeout return value

Two questions: How is the value returned from setInterval and setTimeout (the ones used to clear the timers) calculated? Is it possible for both the functions to return the same value during runtime? For example: var a = setInterval(fn1, 1000); var b = setTimeout(fn2, 1000); Is it possible for a and b to have the same value? The fi...

How can I clearInterval() for all setInterval()?

I've got a setInterval() called in a jQuery plugin, but I want to clear it from my main page, where I don't have access to the variable that the setInterval was stored in. Is there a way to clear all timers present on a page? ...

Will setInterval drift?

Hi This is a pretty simple question really. If I use setInterval(something, 1000), can I be completely sure that after, say, 31 days it will have triggered "something" exactly 60*60*24*31 times? Or is there any risk for so called drifting? ...

jQuery randomly fadeIn images

I have a container with a lot of small images. <div id="container"> <img src="1.jpg" /> <img src="2.jpg" /> <img src="3.jpg" /> ... <img src="100.jpg" /> </div> I set opacity to 0. (not hidding) Then I want to show(fadeIn) random image after half second. for example 5th, 1st, 55th ... Any suggestions, thanx a lot ...

Why does my setTimeout speed up when I have multiple tabs open to my site?

I have a timer that counts down every second. It works great until the user opens up 3 or 4 tabs of the my site, at which point the newest tab's timer goes double or triple speed. I can currently only reproduce the bug in IE8. I was previously using setInterval, and could reproduce the bug in Firefox as well. I'm actually using FBJS (...

Strange behavior from setInterval()

I'm trying to do a very basic date-difference calculation with javascript, but am getting mixed behavior from setInterval(). This updates constantly: var init = setInterval(function(){ document.getElementById("txt").innerHTML = new Date(); }, 1000); But this only updates once: var init = setInterval(function(){ var today = new D...

How to pass an Array object to the setInterval function

I want to pass an object array to the setTimer function in Javascript. setTimer("foo(object_array)",1000); am getting error on this code. Note:Sorry ! some correction in my question : Is it possible in setInterval() function. ...

Changing the interval of SetInterval while it's running

I have written a javascript function that uses setInterval to manipulate a string every tenth of a second for a certain number of iterations. function timer() { var section = document.getElementById('txt').value; var len = section.length; var rands = new Array(); for (i=0; i<len; i++) { rands.push(Math.floor(Mat...

Javascript: How to measure the milliseconds between mousedown and mouseup?

Looks like you can't call setInterval() from the onMouseDown event handler. I tried, didn't work. By John Resig's explanation, this makes sense: http://ejohn.org/blog/how-javascript-timers-work/ So is there any way to measure the difference between the mouse button gets depressed and when it gets released? ...

Checking whether clearInterval has been called?

Given this code: bob = setInterval(function, 1000); clearInterval(bob); Is there now a way to know if that interval has been cleared? Currently, I keep track of this myself, by unsetting 'bob', but I'm curious if my extra line of code is unnecessary: clearInterval(bob); bob = null; if (!bob) itIsCleared(); Thanks! ...

Changing Classes on a Timer Jquery

Hello, I am creating an image banner which has rollover links which change the text and image. What I need to happen is for this to rotate every 5 seconds through the 5 images, but on mouseover it would pause the roation and take you to the image which the user has selected. My Mouseover code is: $("#main_nav li").mouseover( function...

javascript/jQuery setInterval/clearInterval

i'm using setInterval to check if a p(html paragraph) has a certain text value. if it has it i want to clear interval an continue code flow. i'm using this in a jQuery plugin so if the paragraph has tat text value i want to clear interval and then continue with a callback function. so i tried something like this: var checkTextValue = se...

Stop blink (jQuery plugin) using stopInterval

Hi, I am using this jQuery plugin for text blink http://plugins.jquery.com/project/blink But I don't know how to modify it to do a .stopblink() Can someone help? Tanks ...

how to exit from setInterval in Jquery

i need to exit from a running interval if the conditions are correct: var refreshId = setInterval(function() { var properID = CheckReload(); if (properID > 0) { <--- exit from the loop---> } }, 10000); ...

simulating a synchronous XmlHttpRequest

I've read some of the other related questions (http://stackoverflow.com/questions/214491/pattern-for-wrapping-an-asynchronous-javascript-function-to-make-it-synchronous & http://stackoverflow.com/questions/518880/make-async-event-synchronous-in-javascript & there may be more), but I just want to be sure to exhaust all possibilities. M...

how can i stop setInterval

how can i stop and start setInterval on focus and blur.....!! suppose i have a textarea i want to stop setInvterval on textarea focus and restart setInvterval on textarea blur with jquery ...

javascript set interval session management

Gentlemen, I am in the midst of working on a project that is session-based. I was thinking that similar to a bank, I'd create a check and offer users the ability to thwart a session time-out. I was thinking about creating a setInterval that would check a blank page that requires auth. If the timer is getting close to end-times, it'd th...

How to implement setInterval in Delphi ?

In javascript i can use function setInterval("functionName',time); to functionName after time delay. How i can use a function like setInterval in Delphi? Thank a lot. ...