Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to force a document.write to display before processing more script

Status
Not open for further replies.

TerryDad2

Programmer
Jul 10, 2002
29
US
I am trying to get a message displayed on the webpage before moving on to the next page. The simplified code is:

<script language = &quot;vbscript&quot;>
document.write (&quot;Processing Request&quot;)
Function Process
Select Case (parent.ButtonClicked)
Case 0
location.href = &quot;r41.htm&quot;
Case 1
location.href = &quot;r42.htm&quot;
end Select
end Function
</script>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; onload = Process>

The result is that the &quot;Processing Request&quot; text is never displayed and the browser processes for about 10 to 20 seconds (depending upon the request) then displays the second page. No user interaction is wanted. How do I force the &quot;Processing Request&quot; text to be displayed.

Terry
 
move the doc.write into the function

Function Process
document.write (&quot;Processing Request&quot;) A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Thanks for the quick response. My code now reads:
<script language = &quot;vbscript&quot;>

Function Process
document.write (&quot;Processing Request&quot;)
Select Case (parent.ButtonClicked)
Case 0
location.href = &quot;r41.htm&quot;
Case 1
location.href = &quot;r42.htm&quot;
end Select
end Function
</script>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; onload = Process>

Visually, the &quot;Processing Request&quot; does not appear.

Terry
 
sorry went of vac.
there are a few small errors in the function and the calling event.
here's a working model
<script language = &quot;vbscript&quot;>

Function Process
document.write &quot;Processing Request&quot; 'no () needed in vb
Select Case (parent.ButtonClicked)
Case 0
location.href = &quot;r41.htm&quot;
Case 1
location.href = &quot;r42.htm&quot;
end Select
end Function
</script>
<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot; onload = &quot;Process()&quot;>
'you need to enclose the function in &quot;&quot; and use ()

hope that helps A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top