settimeout

JavaScript - Does the browser keep track of active timer IDs?

Does the browser keep track of active setInterval and setTimeout IDs? Or is this solely up to the developer to keep track of? If it does keep track of them, is it accessible via the BOM? ...

Internet Explorer 8 - setTimout redirect to different page

I am trying to redirect the user to a different page after 1 second via javascript: setTimout("document.location.href='new_page.html'", 1000); however, in Internet Explorer, this happens immediately, not 1 second later. Any thoughts? ...

How to use setTimeout / .delay() to wait for typing between characters

Hi all, I am creating a simple listbox filter that takes the user input and returns the matching results in a listbox via javascript/jquery (roughly 5000+ items in listbox). Here is the code snippet: var Listbox1 = $('#Listbox1'); var commands = document.getElementById('DatabaseCommandsHidden'); //using js for speed $('#CommandsFilter...

javascript accordion - tracking time question

Hey all, I was reading up on this javascript tutorial: http://www.switchonthecode.com/tutor...ccordion-menus Basically, it shows you how to create an accordion using pure javascript, not jquery. All made sense to me until the actual part of tracking the animation. He says "Because of all that, the first thing we do in the animation func...

odd behavior setting timeouts inside a function with global references in javascript

Here is the the function and the globals: $note_instance = Array(); $note_count = 0; function create(text){ count = $note_count++; time = 5000; $note_instance[count] = $notifications.notify("create", text); setTimeout(function(){ $note_instance[count].close() }, time); ...

How to delay hiding of a menu with Jquery Dropdown Menu?

I have a dropdown menu that works fine, but I would like it so, that if I hover off the menu, it doesn't immediately hide again. So basically I would like a one second delay. I have read about setTimeout, but not sure if it is what I need? $('#mainnav a').bind('mouseover', function() { $(this).parents('li').children('ul').show(); }...

Issue passing the correct item to an other function with setTimeout

Here's my problem: var slide; $$('#slides li').each(function(i, n) { slide = i; setTimeout("initiateSlide()",n * 500) }); function initiateSlide(){ i = slide; alert(i); // pretty much alerts the last one 5 times } I expect to initiateSlide() with 5 different slides, instead I only get the last one ...

(jQuery) javascript setTimeout clearTimeout

Hi I try to make a page to go to the startpage after eg. 10sec of inactivity (user not clicking anywhere). I use jQuery for the rest but the set/clear in my test function are pure javascript. In my frustation I ended up with something like this function that I hoped I could call on any click on the page. The timer starts fine, but is n...

setTimeout doesn't work with window.location?

i try to rich flash like effect when changing window location, but there is a small problem, i can't solve. look at the script please $(document).ready(function(){ $('a.flash').click(function(e) { e.preventDefault(); $('body').fadeOut(1500); setTimeout("", 1500); ...

document.onclick settimeout function javascript help

Hi, I have a document.onclick function that I would like to have a delay. I can't seem to get the syntax right. my original code is <script type="text/javascript"> document.onclick=check; function check(e){do something} I tried the below, but that code is incorrect, the function did not execute and nothing happened. <script type...

how to make my php page reload each 2 minutes using javascript?

Hi Every two minutes i want to check whether i received some message so want to reload my page every 2 minutes how to reload my php page using javascript ...

jquery 1.4.2 equivalent for setTimeout and clearTimeout..

Is there any equivalent for setTimeout and clearTimeout functions in jquery 1.4.2.... I found this ex which uses jquery 1.3.2.. var alerttimer = window.setTimeout(function () { $alert.trigger('click'); }, 3000); $alert.animate({height: $alert.css('line-height') || '50px'}, 200) .click(func...

Is looping events in JavaScript using document.dispatchEvent possible?

I'd like to create an event loop mechanism in JavaScript/DOM using only dispatchEvent calls. For example: document.addEventListener("LoopingEvent", loop, true); var loop = function() { doSomeWork(); updateUI(); document.dispatchEvent(loopEvent); }; var loopEvent = document.createEvent('Events'); loopEvent.initEvent("Loopin...

Remoting set timeout

.Net remoting is used in my brownfield application. We decided to set timeouts for our remoting methods. System.Collections.IDictionary properties = new System.Collections.Hashtable(); properties["name"] = Ipc_Channel_Name; properties["timeout"] = 1 * 1000; IChannel clientChannel = new IpcClientChannel(properties, null); ChannelServic...

please provide some settimeout() example for loader.gif image to work in IE

I have been trying to display the Loader.gif image when the form is submitted, it works fine with FF browser but doesnt work with IE, I tried with settimeout() function of javascript which helped to resolve the problem for IE but then it was not working with FF So someone could pls provide me a detail working example for both FF and IE?...

Javascript: find the time left in a setTimeout()?

I'm writing some Javascript that interacts with library code that I don't own, and can't (reasonably) change. It creates Javascript timeouts used for showing the next question in a series of time-limited questions. This isn't real code because it is obfuscated beyond all hope. Here's what the library is doing: .... // setup a timeout...

jQuery callback into non-jQuery parent object

See this code: var MyObject = new function() { this.tos = new Array(); this.show = function() { this.clearTimeouts(); $("#divExample").slideDown(null,function() { MyObject.tos[MyObject.tos.length] = setTimeout(function(){MyObject.doSomething();} , 1800); }); return; }; this.doSomething = function...

how to wait with setTimeout until a variable get loaded and, at the same time, receive HTTP requests!

I' ve made a in JavaScript function to check every 100 ms if a global variable is loaded. When the variable will be loaded the function will return the value of the variable as shown below. In my code I use an HTTP server in JavaScript, and the variable will be loaded when a specific HTTP request with specific headers arrive to my server...

Why does jquery fadeOut act strangely with setTimeout?

I have this code: clearTimeout(tooltiptimeout); tooltiptimeout=""; $("#tool").fadeOut("slow").queue(function(){ tooltiptimeout=setTimeout(function(){ $("#tool").css("left",item.pageX-33); $("#tool").css( "top",item.pageY-95); $("#tool").fadeIn("slow"); }, 1000); $(this).dequeue(); }); What it shoul...

Can I see if a timer is still running?

Simple question here that I can't seem to find an answer for: Once a setTimeout is set, is there any way to see if it's still, well, set? if (!Timer) { Timer = setTimeout(DoThis,60000); } From what I can tell, when you clearTimeout, the variable remains at its last value. A console.log I just looked at shows Timer as being '12', n...