473,795 Members | 2,914 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript: race conditions in FF and IE just dies

Plater
7,872 Recognized Expert Expert
So after my previous troubles I now have asynchonous xmlHTTPRequests going.
I send a request on an interval set for 5seconds.

First the FF trouble:
Sometimes when I refresh the page, I'll get an error saying "returnObjB yId is not defined". Now, returnObjById() is my own function that exists and after about 3 of these errors it decides that the function exists and uses it just fine.
It seems to be related to the onreadystatecha nge of the previous page (which is actually the same page I just did a ctrl+refresh) because the error lines it shows are all in the onreadystatecha nge routine. So it's like it is calling those functions for leftover requests before the rest of the javascript is loaded. Very strange. Only started happening after making the request asyncronous.

The IE6 trouble.
When I stop the server that the requests are being made to. The updates stop, no problem there. However once I start the server again, IE does not continue to make the updates. FF starts back up making them. So I am thinking some kind of error is happening but none shows up in the IE javascript error thinger.
EDIT: After waiting a long time for it to start up again, it seems to have killed itself off with a windows error.

Any ideas on how to stop either of these conditions from happening?
Aug 7 '07 #1
5 1840
acoder
16,027 Recognized Expert Moderator MVP
Try clearing intervals on unload.
Aug 8 '07 #2
Plater
7,872 Recognized Expert Expert
Try clearing intervals on unload.
That would make sense except, why is the workspace from a previous html page being carried over? And if that is the case, then shouldn't my other function def's be carried over too?
Aug 8 '07 #3
Plater
7,872 Recognized Expert Expert
I added the clearing of the interval. Seems ok
Also, as another question on good practices.
On aschronous calls, if my xmlhttprequest oject is in say readystate=1, does making another Open()/Send() call cause any troubles?
Or should I only be allowing it try those calls if the readystate=4 (or 0)?

Edit: I did that and it stopped IE from destorying itself (I am guessing it kept making calls and eventually ran out of memory in it's space)
I also have not seen a repeat of my FF troubles, don't know if that was some fluke mistake by the firebug thing or what, at any rate its running smoothly again
Aug 8 '07 #4
acoder
16,027 Recognized Expert Moderator MVP
Well, you got it working. I'm not entirely sure why the problems occur as they do, but it seemed logical from what you described that the interval not being cleared had something to do with it.
Aug 8 '07 #5
Plater
7,872 Recognized Expert Expert
Well it happened again that it reported 3 errors about not finding the function.
I think it's just firebug issues, because it never hould have happened 3times like that instantly. There were no rogue xmlhttprequests happening at the time either. So I'm chalking it up to "don't care" for that one
Aug 8 '07 #6

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

Similar topics

5
15859
by: GIMME | last post by:
One of my coworkers insists that one should never use static methods because race conditions exist. Thinking along the lines that all variable assignments are assignments to static variables. He's wrong. Right? Two users in a web session could both access a static method at the same time and never have any trouble.
13
1508
by: Otto Haldi | last post by:
Hello to all I have a problem with some javascript. On my computer I don't have any problem and the script work well, but somebody told me that my script crash on his computer. Why could something like that happen? Are the a possibility to activate a debug mode to see all the potential errors?
18
5862
by: Urs Vogel | last post by:
Hi I wrote an application server (a remoting sinlgeton), where processes must be stopped in very rare cases, done thru a Thread.Abort(). Occasionally, and only after a Thread.Abort(), this component becomes instabile, throwing a Windows like error (access violation on 0x00000002), not an framework exception. The component and all of its subcomponents are 100% managed code. What could go wrong with Thread.Abort()? Thanks for any hints.
26
11083
by: wardy | last post by:
Hi all, looking for a little bit of help.....I'm currently in the process of trying to understand the impact of the 508 guidelines on a web site that I am involved with, and I have a question surrounding the use of Javascript. The site currently relies on Javascript for navigating from page to page - I cannot find anything in the 508 guidelines like the 6.3 WAI checkpoint for AA compliance: "Ensure that pages are usable when scripts,...
2
3650
by: manuelg | last post by:
Here is a code fragment, where I am trying to copy a file, avoiding overwrites and race conditions. The filename gets a '02','03','04' etc appended to the end if a file with that name already exists. I know the writing of the single space is overkill, but I am surprised I cannot find an example of this floating around the web and newsgroups my understanding of 'os.open' and 'os.fdopen' is minimal ## start fragment
5
2275
by: mars | last post by:
I use TurboGears to do some web service. TurboGears use cherrypy. When web browser access this site, the cherrypy will call my python program. So my program looks like a lib. When web browser access the site, the http server will fock a process or gerenate a thread. I need share some data or operate some files. How can I prevent from race conditions. Is there any way can I lock this. Thank you in advance!
1
1546
by: Larry Bates | last post by:
I have a need to implement a drop folder upload mechanism for secure uploading of files to a server. At first glance this appears that it would be an easy application to write. Then I begin to think about the race conditions that exist between the process that will wake up to upload the files and the fact that the user can add additional files to the drop folder at any point in time. I would like to clear out files/folders after they have...
6
1840
by: Chris Beall | last post by:
(I'm rather inexperienced with JavaScript; the failing page was cobbled together from multiple sources)... http://pages.prodigy.net/chris_beall/STL/Timeline.html If JavaScript is not present, or CSS 2 isn't supported, the page just shows a complete list of dated entries. That's correct. If JavaScript is present and CSS 2 is supported, a subset of the list is shown (Example: 9 Jan 2008 is absent) and a button appears in the upper
0
1839
by: moltendorf | last post by:
I've been trying to find a suitable method for preventing race conditions in my own code. Currently I'm using a file and the flock function to prevent code in other threads from executing at the same time. For example: <?php $pointer = fopen ('./thread.lock', 'a+'); flock ($pointer, LOCK_EX);
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10448
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10167
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3730
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.