Put a message "Please Waiting" during a working

F

Fúlvio

Hello all,

My application delay some minutes when I press a button(it's doing
some working ).
How can I put a message: "Please wating" during this delay? It is
important that after the execution finish this message disappear.


Fúlvio
 
G

GArlington

Hello all,

My application delay some minutes when I press a button(it's doing
some working ).
How can I put a message: "Please wating" during this delay? It is
important that after the execution finish this message disappear.

Fúlvio

Where do you want this message?

<script>
var yourDiv = document.getElementById("plsWait");
yourDiv.innerHTML = "Please wait...";

Do you work here...

yourDiv.innerHTML = "Done, thank you.";
yourDiv.display="none";
</script>

<body>
...
<div id="plsWait"></div>
...
</body>
 
T

tomtom.wozniak

Hello all,

My application delay some minutes when I press a button(it's doing
some working ).
How can I put a message: "Please wating" during this delay? It is
important that after the execution finish this message disappear.

Fúlvio

One way would be to display a pop-up window that says "please wait".
Once your processing has completed, the returning page can then simply
close the pop-up.

Or, you could dive into AJAX and simply hide/unhide parts of your web
page, waiting for the processing to finish.

Are you looking for some javascript code to do this or just wondering
how a "please wait" message could generally work?

-Tom Woz
 
F

Fúlvio

I am waiting for a javascript code.

Fúlvio

One way would be to display a pop-up window that says "please wait".
Once your processing has completed, the returning page can then simply
close the pop-up.

Or, you could dive into AJAX and simply hide/unhide parts of your web
page, waiting for the processing to finish.

Are you looking for some javascript code to do this or just wondering
how a "please wait" message could generally work?

-Tom Woz
 
E

Evertjan.

Fúlvio wrote on 14 feb 2008 in comp.lang.javascript:
[Please do not toppost on usenet]
I am waiting for a javascript code.

Do you want to see this message until this NG submits you that code?
Could you write it on a piece of paper?

==========================

perhaps?

setTimeout('displayMessage()',10);
doTheJob();
clearMessage();
 
F

Fúlvio

Sorry by my delay to answer. I have some problems.

The code that I am trying to work is this:

<HTML>
<HEAD>
<TITLE>New Document</TITLE>
<script type="text/javascript" language="javascript">

function makeRequest() {
conteudo.style.display = 'block';
//here the submit is called and start a process in
another server
//that create a spreedsheet that must be downloaded
conteudo.style.display = 'none';
}
</script>
</HEAD>

<BODY>
<input type="button" name="report_export" value="Download CSV"
onclick="makeRequest()"/>
<div id="conteudo" style="display: none;">Please Waiting</div>
</BODY>
</HTML>



Fúlvio wrote on 14 feb 2008 in comp.lang.javascript:



[Pleasedo not toppost on usenet]
I amwaitingfor ajavascriptcode.

Do you want to see this message until this NG submits you that code?
Could you write it on a piece of paper?

==========================

perhaps?

setTimeout('displayMessage()',10);
doTheJob();
clearMessage();
 
E

Evertjan.

Fúlvio wrote on 21 feb 2008 in comp.lang.javascript:

[Please do not toppost on usenet]
Sorry by my delay to answer. I have some problems.

The code that I am trying to work is this:

<script type="text/javascript" language="javascript">

Leave the language="javascript" out, not necessary in this century
function makeRequest() {
conteudo.style.display = 'block';

This will only work in IE, methinks, use:

document.getElementById('conteudo')
// do something timeconsuming

The effect in most if not all browsers
will only be shown if the JS ends the execution of the function,
so the effect of the ="block" and ="none" wil be nearly symultaneously.
conteudo.style.display = 'none';
}
</script>

<div id="conteudo" style="display: none;">Please Waiting</div>

"Please Waiting" is not English, "Police Waiting" could be.
Use "Please wait".

Try this:

=================================
<script type='text/javascript'>

function makeRequest() {
document.getElementById('conteudo').style.display = 'block';
setTimeout('makeRequest2()',10);
};

function makeRequest2() {
// do something timeconsuming here
document.getElementById('conteudo').style.display = 'none';
};

</script>

<div id='conteudo' style='display: none;'>Please Wait ...</div>
=================================

the delay will set CSS display to block,
before starting the time consuming process.
The ending of the makeRequest2() will set display to none.

Not tested.
 
F

Fúlvio

Hi Evertjan,

Unfortunately your code doesn't work. The problem is that when I call

setTimeout('makeRequest2()',10);

the Thread in the javascript sleep only for 10 miliseconds. After this
time the message disappear
and the process in the server remain working some time that I don't
know. After the process finish
the dialog box appear ask me to download the file that was created
during the process.

// do something timeconsuming here
This line delay between 5 seconds to 5 minutes making a spreadsheet.

Thanks for your help

Fulvio







Fúlvio wrote on 21 feb 2008 in comp.lang.javascript:

[Pleasedo not toppost on usenet]
Sorry by my delay to answer. I have some problems.
The code that I am trying to work is this:
<script type="text/javascript" language="javascript">

Leave the language="javascript" out, not necessary in this century
function makeRequest() {
conteudo.style.display = 'block';

This will only work in IE, methinks, use:

document.getElementById('conteudo')
// do something timeconsuming

The effect in most if not all browsers
will only be shown if the JS ends the execution of the function,
so the effect of the ="block" and ="none" wil be nearly symultaneously.
conteudo.style.display = 'none';
}
</script>

<div id="conteudo" style="display: none;">PleaseWaiting</div>

"PleaseWaiting" is not English, "Police Waiting" could be.
Use "Pleasewait".

Try this:

=================================
<script type='text/javascript'>

function makeRequest() {
document.getElementById('conteudo').style.display = 'block';
setTimeout('makeRequest2()',10);

};

function makeRequest2() {
// do something timeconsuming here
document.getElementById('conteudo').style.display = 'none';

};

</script>

<div id='conteudo' style='display: none;'>PleaseWait...</div>
=================================

the delay will set CSS display to block,
before starting the time consuming process.
The ending of the makeRequest2() will set display to none.

Not tested.
 
E

Evertjan.

Fúlvio wrote on 21 feb 2008 in comp.lang.javascript:
Hi Evertjan,

[Please do not toppost on usenet]
Unfortunately your code doesn't work. The problem is that when I call

setTimeout('makeRequest2()',10);

the Thread in the javascript sleep only for 10 miliseconds. After this
time the message disappear
and the process in the server remain working some time that I don't
know. After the process finish
the dialog box appear ask me to download the file that was created
during the process.

// do something timeconsuming here
This line delay between 5 seconds to 5 minutes making a spreadsheet.

Thanks for your help

Fulvio







Fúlvio wrote on 21 feb 2008 in comp.lang.javascript:

[Pleasedo not toppost on usenet]
Sorry by my delay to answer. I have some problems.
The code that I am trying to work is this:
<script type="text/javascript" language="javascript">

Leave the language="javascript" out, not necessary in this century
function makeRequest() {
conteudo.style.display = 'block';

This will only work in IE, methinks, use:

document.getElementById('conteudo')
// do something timeconsuming

The effect in most if not all browsers
will only be shown if the JS ends the execution of the function,
so the effect of the ="block" and ="none" wil be nearly symultaneousl y.
conteudo.style.display = 'none';
}
</script>

<div id="conteudo" style="display: none;">PleaseWaiting</div>

"PleaseWaiting" is not English, "Police Waiting" could be.
Use "Pleasewait".

Try this:

========================
 

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

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,371
Latest member
Brkaa

Latest Threads

Top