How do I call a VBScript-function from JavaScript in ASP (both server-side) 
Author Message
 How do I call a VBScript-function from JavaScript in ASP (both server-side)

Hi!

I'm having a problem calling a vb-function from JavaScript in Asp3.0.
The below code just won't work. Any suggestions?

- Michael

-------------------------------------------------------------------------

<SCRIPT LANGUAGE=VBScript RUNAT=Server>

Function Test()

 Response.Write("This is the VB function named Test")

End Function

</SCRIPT>

<SCRIPT LANGUAGE=JavaScript RUNAT=Server>

 Test();

</SCRIPT>

Microsoft JScript runtime error '800a138f'

Object expected, line 13



Sun, 29 Jun 2003 20:54:41 GMT  
 How do I call a VBScript-function from JavaScript in ASP (both server-side)
The order in which <script runat=server> blocks are executed is not
the order they're encountered in the page. The JScript code is being
run before the VBScript, so the object (function) doesn't exist.

One of the rules is that script blocks in languages other than the


asp and the VBScript block will execute first, eliminating the error.

It's usually less confusing to include only functions/subroutines in
<script runat=server> blocks and place all the main code in <% %> blocks.

=-=-=
Steve
-=-=-


Quote:
> Hi!

> I'm having a problem calling a vb-function from JavaScript in Asp3.0.
> The below code just won't work. Any suggestions?

> - Michael

> -------------------------------------------------------------------------

> <SCRIPT LANGUAGE=VBscript RUNAT=Server>

> Function Test()

>  Response.Write("This is the VB function named Test")

> End Function

> </SCRIPT>

> <SCRIPT LANGUAGE=JavaScript RUNAT=Server>

>  Test();

> </SCRIPT>

> Microsoft JScript runtime error '800a138f'

> Object expected, line 13



Sun, 29 Jun 2003 22:59:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Calling client-side javascript function from server-side vbscript

2. Calling client-side javascript from server-side vbscript

3. Calling Server Side JScript from Server Side VBScript

4. Calling a server side script function from VBScript

5. Calling a server side VBscript function?

6. Calling server-side function from client-side

7. pass server side vbscript to client side javascript

8. Help- Client script calling server side function

9. How to call server side javascript?

10. Function doesn't run in server side javascript

11. Functions don't run in server side javascript

12. Server side (asp) ActiveX dll calls problem (Form open)

 

 
Powered by phpBB® Forum Software