473,385 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.Show(); //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.Hide();//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.Show();

var DisplayTimer = setTimeout("FunctionCall1();FunctionCall2();Functi onCall3();SomeSVGDialog.Hide();",
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 3315
Ron
"Stephan Parrot" <ka*****@hotmail.com> wrote in message
news:35**************************@posting.google.c om...
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.Show(); //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.Hide();//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.Show();

var DisplayTimer = setTimeout("FunctionCall1();FunctionCall2();Functi onCall3();SomeSVGDialog.Hi
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
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...
27
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
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...
12
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(" &...
2
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...
42
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)...
10
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...
3
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...
1
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.