Simulating Alert / Confirm

T

Tony

Basically, I have to find a way to hold up execution of a script while
I wait for a button to be clicked, in the same manner as alert() or
confirm() do, but without using either of those.

The basic idea is that an "alert" box is created with one or two
buttons on it, then when a button is clicked the script completes.

I've tried something like

do {
isClicked = confirmClick;
} while (!isClicked);

and the button has onclick='confirmClick=true'

but when I try this, I get an error that the javascript is taking too
long to execute & do I want to cancel it... :(

Is there any way at all to do this? I thought that using a loop like
that would do the trick, but it appears that it won't...
 
E

Evertjan.

Tony wrote on 26 jan 2006 in comp.lang.javascript:
Basically, I have to find a way to hold up execution of a script while
I wait for a button to be clicked, in the same manner as alert() or
confirm() do, but without using either of those.

You cannot, that is not the way js works.

Rewrite your code, so that the rest of the code is in a function executed
on pressing the relevant button.
 
T

Tony

Evertjan. said:
Tony wrote on 26 jan 2006 in comp.lang.javascript:


You cannot, that is not the way js works.

Rewrite your code, so that the rest of the code is in a function executed
on pressing the relevant button.

That's what I was afraid of - I have a whole team of other developers
working on the server-side code that generates these alerts & confirms
- that's going to add a lot of extra work. I was hoping to avoid that
:(

Ah, well, I guess I should consider it job security...
 
E

Evertjan.

Tony wrote on 26 jan 2006 in comp.lang.javascript:
That's what I was afraid of - I have a whole team of other developers
working on the server-side code that generates these alerts & confirms
- that's going to add a lot of extra work. I was hoping to avoid that
:(

Ah, well, I guess I should consider it job security...

It is a question of the way old programming looked at a programme as a
long line of statements, where the user was not in charge and reluctantly
was allowed to answer preformed questions, while new programming sees the
user as the one GIVING assignments to the programme by pressing a choice
of buttons.

The concept of modularity, started by abolishing the Basic "Goto"
statement, fits perfectly in this concept.

The ww-web also gives the power to the user, and the frustrated
struggling programmers on these NGs are repeatedly asking for independent
server originated actions where all actions should start from the browser
asking the server for action.

;-} / ;-{
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top