473,811 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript execution sequence problem

Hello people!

I have a really weird problem here...
Let's say i have 4 lines of codes in a function like this one:
SomeSVGDialog.S how(); //this is an SVG dialog box that shows to give
some feedback
FunctionCall1() ; //these functions calls webforms via XMLHTTP and
erform stuff
FunctionCall2() ;
FunctionCall3() ;
SomeSVGDialog.H ide();//thide the feedback window

OK... The way I see it, the normal sequence of events would be, the
feedback form is displayed, then, FunctionCall1, FunctionCall2 and
FunctionCall3 are executed and then the feedback window would hide,
right?

WRONG!!!
Right now, the feedback window isnt even displayed...
all operations are performed but i dont see the feedback form showing
up...
I have found a quick fix to that but its not really pretty...
I am doing this:

SomeSVGDialog.S how();

var DisplayTimer = setTimeout("Fun ctionCall1();Fu nctionCall2();F unctionCall3(); SomeSVGDialog.H ide();",
500);

this work perfectly!!

Someone told me it may be because i am running the client javascript
code on a machine with multiple processors... Which is correct but i
didnt have the opportunity to test it on a single processor machine
yet...
In any case, id like to know if someone knows why this happens and how
to fix it if possible because i cannot assume users will all have
single CPU machines...

Thanks in advance!

Stephan Parrot
Jul 23 '05 #1
2 3349
Ron
"Stephan Parrot" <ka*****@hotmai l.com> wrote in message
news:35******** *************** ***@posting.goo gle.com...
Hello people!

I have a really weird problem here...
Let's say i have 4 lines of codes in a function like this one:
SomeSVGDialog.S how(); //this is an SVG dialog box that shows to give
some feedback
FunctionCall1() ; //these functions calls webforms via XMLHTTP and
erform stuff
FunctionCall2() ;
FunctionCall3() ;
SomeSVGDialog.H ide();//thide the feedback window

OK... The way I see it, the normal sequence of events would be, the
feedback form is displayed, then, FunctionCall1, FunctionCall2 and
FunctionCall3 are executed and then the feedback window would hide,
right?

WRONG!!!
Right now, the feedback window isnt even displayed...
all operations are performed but i dont see the feedback form showing
up...
I have found a quick fix to that but its not really pretty...
I am doing this:

SomeSVGDialog.S how();

var DisplayTimer = setTimeout("Fun ctionCall1();Fu nctionCall2();F unctionCall3(); SomeSVGDialog.H i
de();", 500);

this work perfectly!!

Someone told me it may be because i am running the client javascript
code on a machine with multiple processors... Which is correct but i
didnt have the opportunity to test it on a single processor machine
yet...
In any case, id like to know if someone knows why this happens and how
to fix it if possible because i cannot assume users will all have
single CPU machines...

Thanks in advance!

Stephan Parrot


Stephen,

What happens if you add an Alert() to stall the program flow after the
window open routine?

I'm wondering if the time taken to launch the new window is more than the
time taken to execute the other functions, so the window closes before you
get to see it.
Your workaround with a timer tends to support this.
how about just commenting out the close window ? What happens then.

HTH

Ron
Jul 23 '05 #2
Hi Ron, thanks for the reply!

Ok... I tried to remove the .Hide call and the window is displayed after
the 3 functions call after it...

I've put alerts too... Before and after... went ok... sequentially...
So... Either its the svg viwer pluggin that takes too much time to
generate the svg from the javascript OR it's because the viewer wait for
the function to exit before drawing it on screen... You know?
The function must be interpreted entirely before letting the viewer do
his job...

In any ways, i'm stuck with the timer solution right now and i'm not
happy with it...

I'll do some other tests and try to speak with guys from the svg
community if they know about that problem...

If you have some explanation for me or anything that could be helpfull,
please let me know!

If i find the solution or if someone directs me to one, ill let the
forum know.

Thanks a lot!

Stephan Parrot

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2539
by: Andy Fish | last post by:
Hi, I want to use an anchor tag to invoke some javascript and I've read that it's bad form to use <a href="javascript:foo()"> I've read endless usenet posts and hint sites on the net, they all suggest different things and I can't get any kind of consistency, and I can't find any solution that works properly for IE, opera and mozilla. many of the recommended solutions go something like this:
27
2281
by: C Gillespie | last post by:
Dear All, Hopefully I have a simple problem. Basically, I just want to alter some text with JS. Here is some of my test code: <snip> <script type="text/javascript"> var tmp='a';
11
3483
by: rahul8143 | last post by:
Does printf output depends on compilers or operating systems? I have one program int main() { int i=5; printf("%d %d %d",i++,i++,i++); return 0; } Output of this program on DOS (TC) 7 6 5 Output of this program on Windows (VC++) 5 5 5
12
9648
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" & Chr(34) & PopUpWindowTitle & Chr(34) & ", " & Chr(34) & CurrentEventDetails & ")" strTemp += "<BR><A HREF='#' onClick='" & PopupLink & "'>" & EventName & "</A><BR>" The problem I have is that when the string variables or contain a string with an...
2
1929
by: Water Cooler v2 | last post by:
http://www.w3schools.com/js/js_whereto.asp This link is to a JavaScript tutorial on w3schools. The page says that a script put in the HEAD is executed only when called, whereas one put in the BODY is executed as the page loads (implying invariably, whether called or not). To test, I tried the following two pages:
42
2363
by: Sabiyur | last post by:
Hi all, one of the recent post gives the macro to do swap #define SWAP(m, n) (tmp = (m), (m) = (n), (n) = tmp) This macro will work, if the execution is from left to right. That is step 1) tmp=m step 2) m=n step 3) n=tmp
10
12812
by: John Passaniti | last post by:
(Note: This is not the same message I posted a week or so ago. The problem that prevented my previous attempt to work was a silly error in the template system I was using. This is a problem involving variable scope in JavaScript.) I have a lot of code that generates HTML on the fly. This code has tags with id attributes derived from variables. A small example: blah('<span id="' + dev + '_' + mod + '">...</span>');
3
3932
by: willyWEB66 | last post by:
Hi everyone, I'm having problem with the sequence of execution for xml.onload. It works fine if your not passing parameters to onload event but my code needs to pass parameter to its function. I'm able to research ablut passing parameters for onload event. However my problem is it only executes on the last instance of loading the XML. I'm sure ur all pretty confused. I'll show some of the javascript code: <script...
1
2884
by: Philip Semanchuk | last post by:
On Oct 12, 2008, at 5:25 AM, S.Selvam Siva wrote: Selvam, You can try to find them yourself using string parsing, but that's difficult. The closer you want to get to "perfect" at finding URLs expressed in JS, the closer you'll get to rewriting a JS interpreter. For instance, this is not so hard to understand: "http://example.com/" but this is:
0
9727
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
9605
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
10647
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
10386
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
10398
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,...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7669
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
6889
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
5554
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...

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.