Calling Jscript Function from Vbscript? 
Author Message
 Calling Jscript Function from Vbscript?

Hello all,
Is it possible to call a jscript function from within VBScript?  Am I making
this too complicated?
Any help would be appreciated.

Kirk



Tue, 17 Apr 2001 03:00:00 GMT  
 Calling Jscript Function from Vbscript?
I call VBScript from JScript so I do not see why it would not work.

(JScript)
 var ldSixMonthDate = new Date(VBSDateAdd("m", -6, getDate()));

where VBSDateAdd is simple VBScript which wraps the VB DataAdd functionality
For more info go to
http://msdn.microsoft.com/developer/news/feature/vs6release/default.htm
there is an article on this topic

Lee

Quote:

>Hello all,
>Is it possible to call a jscript function from within vbscript?  Am I
making
>this too complicated?
>Any help would be appreciated.

>Kirk



Tue, 17 Apr 2001 03:00:00 GMT  
 Calling Jscript Function from Vbscript?
Sure, here's a simple example:

<script language="vbscript">

function myNumber(num1)
    myNumber = formatnumber(num1,2)
end function

</script>

<script language="javascript">

document.write(myNumber(4))

</script>

Although remember that this won't work in Netscape... so if you are using
JavaScript for compatibility reasons, obviously it goes for naught.  Just
about anything you can do in JavaScript can be done in VBScript... and FWIW,
learning how to convert between the two can be a very valuable asset.

   _______________________________________
   Aaron Bertrand [MVP]

   "When the President does it,
    that means it is not illegal."
           - Richard Nixon


Quote:
>Hello all,
>Is it possible to call a jscript function from within vbscript?  Am I
making
>this too complicated?
>Any help would be appreciated.



Tue, 17 Apr 2001 03:00:00 GMT  
 Calling Jscript Function from Vbscript?
Thanks...Once again I seem to be struggling with syntactical errors - those
dreaded '()' are killing me - all over the place.  Practice will eventually
get to perfection I presume??

Kirk

Quote:

>Sure, here's a simple example:

><script language="vbscript">

>function myNumber(num1)
>    myNumber = formatnumber(num1,2)
>end function

></script>

><script language="javascript">

>document.write(myNumber(4))

></script>



Tue, 17 Apr 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Calling JScript function from VBScript code

2. Call JScript function from VBScript

3. Calling Jscript Function from Vbscript?

4. calling vbscript function from jscript

5. calling vbscript function from jscript?

6. call a jscript-function in the vbscript-part of an asp-page

7. How to call a VBScript function in JScript?

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

9. Does VBScript has a function similar to JScript function eval

10. Can browser call Jscript function automaticaly when page loads

11. Calling a function defined in a linked JScript file

12. how an applet can fire a jscript event (or call a function)

 

 
Powered by phpBB® Forum Software