setinterval

setInterval window focus and hibernation

I've run into an odd issue. I have a javascript which uses setInterval to keep a session alive. But, it seems that if the browser is left unattended for a period (either leaving it open over night, or out of focus working in another application) the setInterval is not firing in IE and the session is allowed to expire. This does not happe...

setInterval / clearInterval Issue inside it's scope

I have the following code, and it works fine until i hit the the #play button. I'm assuming it's because the var intID is set in another place and it's not in the same scope when i window.clearInterval() it... how do I fix this? BTW, this is the Google Maps API Version 3 function intervalTrigger(){ return window.setInterval(fu...

Javascript Loop & setInterval

This js will take a value, subtract X amount from it, and then count up to that value. I attempted to accomplish this task by doing a simple while loop, but I couldn't get it work. I was wondering if anyone could comment on how or why the while loop method below doesn't work. This is the only way I could get it to work: function _in...

Store a javascript interval in a jQuery element.data object?

Hi! I'm working on a jQuery plugin (a jQuery UI widget) called Smooth Div Scroll where I need to store references to intervals that are specific to each individual instance of the plugin on the page. If i just write something like this: var myInterval = setInterval(function() { alert("Hi!"); }, 100); ...the variable myInterv...

jQuery/Javascript: setInterval check if DOM element exists?

hey guys, var check; function showLoader() { $('#mc_signup_form').prepend('<span class="loading"> loading &hellip;</span>'); check_init(); } function check_init() { check = setInterval('check_trigger()', 300); } function check_clear() { clearInterval(check); } function ...

Problem with IE and setInterval() not refreshing/updating.

Hello. I'm using JavaScript/Jquery to make a page auto-update with a value from a database, although it doesn't seem to update in Internet Explorer. It works fine in FireFox & Chrome. Can anyone explain what's wrong? It looks like IE is just displaying a cached version of the page. How can I prevent this happening? Thanks. function upda...

Flash AS2 interval problem

I'm using an interval for fade in effect of some objects in flash, but for some reason I can't get it to work if it's called on more than one object. function fadeInPage (pageName) { pageName._visible = true; alpha = 0; fade = setInterval(fadeIn, 15); function fadeIn() { alpha += 5; pageName._alpha = alpha; if (alpha>...

Trouble with setInterval and undefined arguments

I'm trying to create a basic strobe light in the browser using the canvas element. I'm expecting setInterval to keep calling the changeBG function to change to a random background color. This function works fine on its own, but not when called by setInterval. I tried pulling up this page in firebug and it told me that colors was undefine...

How to kick-ass pass scope through "setInterval"

Dear Masterminds, I'm currently wondering if there is a better solution than passing this scope to the lambda-function via the parameter 'e' and then passing it to 'funkyFunction' using call()-method setInterval(function(e){e.funkyFunction.call(e)}, speed, this) (Minor question aside: I'd been reading something about memory-leaks in ...

Why do people say that javscript eval() is evil but you get no objections against setTimeout and setInterval etc ?

if I am not mistaken eval executes valid code in a given string eval("alert('hey')"); and setTimeout("alert('hey')",1000); does just about the same thing, only with a timer. is set timeout just as risky as eval? ...

How to use setInterval and clearInterval for infinite gallery

I am trying to fetch pictures for a gallery using JavaScript, but I experience problems. $(document).ready(function() { var currentPage = 1; var totalPics = 2; var picPerPage = 1; intervalID = window.setInterval(function() { console.log(currentPage*picPerPage); if (totalPics > (currentPage*picPerPage...

What is a good setTimeout interval for polling in a IE?

I have an ActiveX object (who source code I have) running in a browser (IE). The ActiveX object has a UI, which raises events. I want to respond to those events in the browser. I don't want to invoke JavaScript functions from the ActiveX object events: and therefore, instead, I want the JavaScript to poll a method of the ActiveX object ...

javascript animation issue: wrong p tag fades in during animation and links don't hide as supposed to

Hey all, I have two problems with the below javascript that I'm not sure why they're not behaving expected as they should. I'm almost positive it should work but it doesn't. First, the left button doesn't hide when the left most p tag (the first one) for group1 is active even though it should, and the right button doesn't hide when the ...

Rotating banner using clearInterval Actionscript 2

Hi All, I am creating a rotating banner. I have a loader swf file which I unload and load with the the new swf file every 15 seconds using set interval. It's going ape shit though and I am not sure what is causing this. Could someone please have a look at my logic and let me know where I am going wrong please? Many thanks! var navArr...

HTML5 + Jscript with JQuery, setInterval problem

Please can someone tell me why this isn't working before I defenestrate everything on my desk. I have the following html document: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html";...

Is it ok to keep on updating Date Time using Javascript's setInterval method?

I am using Javascript's setInterval method to keep on updating the time of the Client computer. This is my code: $(document).ready(function() { setInterval(function() { setCookieForDate(); }, 500); }); function setCookieForDate() { var cookie_date = new Date(); var serverDateTime = '<%=DateTime.Now%>'; document.cookie =...

setInterval jsf2.0 glassfish v3 and memory Leaks

Hi, guys i'm new and i'm not english. I have a problem with using js setInterval that simulate a user click, every X seconds, on submit button. In the page there is only one h:form and h:commandButton. I use a profiler and i see that the java.util.HashMap increase continuosly it's size. After some hours the used heap size is growed a lot...

Auto-scrolling in jQuery.scrollTo / jQuery.serialScroll works like crazy

Hi, I used the following tutorial to make a parallax content slider for my webiste: http://blog.themeforest.net/tutorials/create-a-funky-parallax-background-effect-using-jquery/ I got it working nicely, but wanted to add auto-scrolling functionality. I did it by adding jQuery.serialScroll and using setInterval but it works like crazy n...

Using setTimeout to bypass IE script warning

Hi, I'm trying to write a web app that uses Javascript to perform a fairly complex calculation (involves factorials and Bessel functions). When I run the script in IE, it gives me a warning that the script is unresponsive or taking a long time, and asks if I want to continue running it. I've read that to get around this, you can use e...

Flash «a script in this movie» - caused by loadVars or setInterval?

Hi Forum This is someting weird... I have a Flash-file that loads external SWFs. There I use LoadVars to get external data from a server. When the data has arrived, I'm using setInterval to call a function that fades-in the content. So far so good. But when I switch menus (a.k.a. unload one movie to load another) before all the data...