
call a jscript-function in the vbscript-part of an asp-page
Your javascript is client side and does not execute until the server has
finished processing the server side ASP, and sends the page to the browser.
A work around would be to "response.write" the data to the page as a bunch
of function calls, that will add up when the page is processed by the
browser. Example below:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function start(getrs) {
// add recordset
}
</SCRIPT>
</HEAD>
<BODY>
<%
sql = "SELECT * FROM Aktuell "
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "prodega"
Set RS = Server.CreateObject("ADODB.Recordset")
Set RS = Conn.Execute(sql)
response.write "<script language=Javascript>"
while not RS.eof
iRecordCount = iRecordCount + 1
response.write "start(" & chr(34) & RS("AktuellNr") & chr(34) & ")"
RS.MoveNext
wend
response.write "</script>"
RS.close
Conn.close
%>
</BODY>
</HTML>
This will create the client side data that you need for the function to
operate correctly.
..> August B.
..> AA,C-TEC WebDevelopment
Quote:
> I get records from a access-db. Then in the loop of the result (while not
> eof) i want call a jscript-function ant i want give
> the current recordset to this function, to put them in a object-array.
> But how can i call the java-function within vbscript?
> <HTML>
> <HEAD>
> <SCRIPT LANGUAGE="JavaScript">
> function start(getrs) {
> // add recordset
> }
> </SCRIPT>
> </HEAD>
> <BODY>
> <%
> sql = "SELECT * FROM Aktuell "
> Set Conn = Server.CreateObject("ADODB.Connection")
> Conn.Open "prodega"
> Set RS = Server.CreateObject("ADODB.Recordset")
> Set RS = Conn.Execute(sql)
> while not RS.eof
> start(RS("AktuellNr"))
> 'this call of a java-function does not work
> RS.MoveNext
> wend
> RS.close
> Conn.close
> %>
> </BODY>
> </HTML>
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----