Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript execution sequence problem

Reply
Thread Tools

Javascript execution sequence problem

 
 
Stephan Parrot
Guest
Posts: n/a
 
      04-06-2004
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
 
Reply With Quote
 
 
 
 
Ron
Guest
Posts: n/a
 
      04-06-2004
"Stephan Parrot" <> wrote in message
news: 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


 
Reply With Quote
 
 
 
 
Stephan Parrot
Guest
Posts: n/a
 
      04-07-2004
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Execution sequence with postfix increment and pass by reference Marcel Müller C++ 9 07-20-2008 03:04 PM
how to iterate over sequence and non-sequence ? stef mientki Python 13 10-20-2007 10:21 AM
code execution sequence Eugene Anthony ASP .Net 2 04-22-2007 09:05 PM
BOOT SEQUENCE (how to change boot sequence) bird Computer Support 13 12-24-2003 02:20 AM
function execution sequence problem Paul Javascript 5 11-14-2003 05:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57