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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I call a Javascript function from vbscript on an ASP page?

Status
Not open for further replies.

Coder7

Programmer
Oct 29, 2002
224
US
On an ASP page:
-----------------------
I need to call this javascript:

function fnDelEdit(pOpCd, pTxId, pCommentType, pCommentSeq, pOwnerType, pOwnerSeq, strCreatedBy)
-----------------------
from this vbscript:

If NOT ( objRs.BOF And objRs.EOF ) Then
Call writeRecords(pPgNbr, objRs)
Else
CALL THE JAVASCRIPT function fnDelEdit
End If
-----------------------
I cannot figure out how to do this. Your assistance is greatly appreciated. Thank you.
 
I assume that you are trying to call a client-side JavaScript function from server-side ASP running VBScript.

Seeing your code example, I will tell you that it is not wise to call a client-side function during a walk through an ADO recordset.

But if you are young and inexperienced and you need your broken, then read about the Buffer property of the Response object here:

"VBScript and ASP Code: Demonstrating the Buffer Property of the Response Object"

After you read that then couple the code designs found there with this:

<%
For vCounter = 2 To 100
Call basDelaySec(0.5)
%>
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;><!--
/*
Assigning window.document.all(&quot;progressBar&quot;)
to an object variable fails during page load.
*/
window.document.all(&quot;progressBar&quot;).style.width = '<%=vCounter%>%'
window.document.all(&quot;progressBarText&quot;).innerHTML = '<%=vCounter%>% Complete'
//-->
</script>
<%
Response.Flush
Next
%>

Bryan Wilhite
info@songhaysystem.com
 
I was actually thinking that was a server-side javascript, let me know if it was I have a solution around here somewhere to call server-side js from server-side VBScript in ASP

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top