473,505 Members | 13,982 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why setTimeout is needed?

22 New Member
Real Questions:
1. Why do we need such timeouts in Javascript?
2. Is there any standard and elegant workaround for such timeouts?
3. What causes these inconsistencies because of timeout not put? Is that the order of the js files being downloaded or anything else?

Background:
If you need the background is like the following
We have a grid solution in place for the HTML tables.

This HTML table can be resized, some columns can be made hidden, columns can be dragged and dropped to change their ordering.

This all is implemented using javascript. Also AJAX request is fired on unload of the page so that whatever changes the user has made can
be stored in session. If user visits the same page again, then these settings from the session can be "reapplied" and user does not have to do it again in the same session.

This reapplication is done like the following - we paint all the HTML table and then on top of that we apply users settings from session, like hide this column and make another wider etc.
This is all working fine.

Now we wanted to introduce "default settings" for particular pages.
Like less needed columns can be default hidden and columns like description can be default wider and so on.

What we did was to read the default settings from a properties file and add them in the session when user first vists the page.
So that our "reapplying" logic will pick the settings [we save them in a hidden variable on the page] and next working will be as it is in the above case.

But the settings are not getting applied for no apparent reason.

We do not get a JS error or anything.

The wierd this is that if we add one alert somewhere, the issue disappears and the default settings are applied properly.
If we remove the alert, it does not work.

We figured this is a delay issue and added some delay using javascripts setTimeout method. It works fine when delay is applied.
But it is taking delay in seconds when onsite environment is accessed. Locally it runs with delay of about 1 ms.

Value your each suggestion. Thanks in advance!

Regards,
Mar 16 '07 #1
1 1283
acoder
16,027 Recognized Expert Moderator MVP
Are you experiencing this problem in every browser (that you test on) or is it limited to one browser? Which browsers have you tested on?
Mar 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1420
by: Dennis M. Marks | last post by:
There is no problem with the following function. I want to insert code at the point that the function does not repeat. I was pretty sure that it could be inserted at the /// but that repeats with...
2
7666
by: JellyON | last post by:
Hi. I'm a little bit lost trying to insert a setTimeout() for recursive call containing string and numeric parameters. Here is a generic example of what I would like to succeed to do : ...
6
1740
by: daveyand | last post by:
Hey Guys, I've stumped. I created a function that does various things to select boxes. Namely Get All selected indexes, populate array with these values
11
568
by: David | last post by:
Hi, I'm trying to set a delay for an onmouseout function on a simple list menu. I don't understand why the code below doesn't work. If on the onmouseout I use ( this.className="hide"; ) it hides...
1
9504
by: bizt | last post by:
Hi, I have a process where every so often I refresh a table's data using a setTimeout() .. and when its no longer needed, a clearTimeout(). The following is a simple example of how this is...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4699
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.