B
Bob
Below is sample code that illustrates what I'm trying to do. For sake
of brevity I didn't include the properties of buildBtn that determine
what data to request.
The problem is I never see "Processing request" and depending on
server utilization the response can take several seconds to load
leading the users to wonder if the system is working. Unfortunately
getting rid of the users is not an option so any help I can get on
making this work is greatly appreciated.
TIA,
Bob
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script type="text/javascript">
// dynamically build button
function buildBtn(val){
function evt(){
results.innerHTML = '<h2>Processing request</h2>';
// Use for loop to simulate time it takes to
// get results page from server
for (var i=0; i<1500000; i++)
null;
// display results
results.innerHTML = "<h2>" + btn.value + " results</h2>";
}
var btn = document.createElement('input');
btn.type = "button";
btn.value = val;
btn.onclick = evt;
document.body.appendChild(btn);
}
</script>
</HEAD>
<BODY>
<script type="text/javascript">
var b1 = new buildBtn('button 1');
var b2 = new buildBtn('button 2');
</script>
<div id="results" />
</BODY>
</HTML>
of brevity I didn't include the properties of buildBtn that determine
what data to request.
The problem is I never see "Processing request" and depending on
server utilization the response can take several seconds to load
leading the users to wonder if the system is working. Unfortunately
getting rid of the users is not an option so any help I can get on
making this work is greatly appreciated.
TIA,
Bob
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script type="text/javascript">
// dynamically build button
function buildBtn(val){
function evt(){
results.innerHTML = '<h2>Processing request</h2>';
// Use for loop to simulate time it takes to
// get results page from server
for (var i=0; i<1500000; i++)
null;
// display results
results.innerHTML = "<h2>" + btn.value + " results</h2>";
}
var btn = document.createElement('input');
btn.type = "button";
btn.value = val;
btn.onclick = evt;
document.body.appendChild(btn);
}
</script>
</HEAD>
<BODY>
<script type="text/javascript">
var b1 = new buildBtn('button 1');
var b2 = new buildBtn('button 2');
</script>
<div id="results" />
</BODY>
</HTML>