call a jscript-function in the vbscript-part of an asp-page 
Author Message
 call a jscript-function in the vbscript-part of an asp-page

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>



Mon, 18 Mar 2002 03:00:00 GMT  
 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 ==-----


Mon, 18 Mar 2002 03:00:00 GMT  
 call a jscript-function in the vbscript-part of an asp-page
You cannot do this because you are trying to call a client-side script from
the server-side. Try this as a work around:

response.write ("<SCRIPT LANGUAGE=""JavaScript"">")
            while not RS.eof
response.write ("start(" & chr(34) & RS("AktuellNr") & chr(34) & ")"
                RS.MoveNext
             wend
response.write ("</SCRIPT>")

This will create a client side javascript with the data that you need. It
should execute when the browser interepts the javascript.

..> 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 ==-----


Mon, 18 Mar 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How do I call JScript functions from within ASP written in JScript

2. Calling a JSCRIPT From a VBScript Function

3. Calling VB function from jscript/vbscript?

4. call jscript function on webbrowser page

5. Can browser call Jscript function automaticaly when page loads

6. Page Loading issues if jscript functions called

7. Calling VBA functions in an Access database from an ASP page

8. Call a function in ASP page

9. calling vbscript function from jscript

10. Calling JScript function from VBScript code

11. Calling Jscript Function from Vbscript?

12. calling vbscript function from jscript?

 

 
Powered by phpBB® Forum Software