vbscript javascript question 
Author Message
 vbscript javascript question

is there a way to read a variable assigned in VBScript in
a javascript  function ?

tia,
dk



Sun, 26 Dec 2004 04:21:40 GMT  
 vbscript javascript question
Way to pass values vbscript to jscript

<SCRIPT LANGUAGE="VBSCRIPT">
Function makeArrayVB()
    ' Creates a VBScript array
    dim anArray(1,1)
    anArray(0,0) = "0,0"
    anArray(0,1) = "0,1"
    anArray(1,0) = "1,0"
    anArray(1,1) = "1,1"
    makeArrayVB = anArray
End Function

<SCRIPT LANGUAGE="JavaScript">
// Accesses a VBScript array within a JScript script
function getVBArray(){
    var arrayObj;
    var jsArray;
    arrayObj = makeArrayVB();
    jsArray = VBArray(arrayObj).toArray();
    alert("VBScript array length = " + jsArray.length);
    // Displays the contents of the array
    for(i=1;i<=jsArray.length;i++){
       alert(jsArray[i-1]);
    }

Quote:
}

</SCRIPT>

Unfortunately, the reverse is not possible.

I think It might work for your solution.

S. A. Hasnut
MCSD, CIW A
It Magnet
http://itmagnet.com.au

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 26 Dec 2004 05:13:25 GMT  
 vbscript javascript question
Use a hidden form field as a transport.
<input type=hidden name=thename>
In JS:
document.forms[x].thename.value = somevalue;
In VBS:
myVar = document.all(thename).value

I think the reverse would work like a charm too.

Cheers,
Andr&eacute;s


Quote:
> is there a way to read a variable assigned in vbscript in
> a javascript  function ?

> tia,
> dk



Sun, 26 Dec 2004 05:28:36 GMT  
 vbscript javascript question
Yes; just call the function from vbscript with the variable as an
argument and it will be passed.

--
Please respond in the newsgroup.  I've still got unread email from the
week Win95 was released, if that tells you anything.
http://www.bittnet.com/winremote
http://www.bittnet.com/scripting


Quote:
> is there a way to read a variable assigned in vbscript in
> a javascript  function ?

> tia,
> dk



Sun, 26 Dec 2004 08:45:41 GMT  
 vbscript javascript question

:: Yes; just call the function from vbscript with the variable as an
:: argument and it will be passed.
::

This was a loaded question (answered on another thread). The vbscript variable is server side ASP and the jscript variable is client side browser ;-)...

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Sun, 26 Dec 2004 09:42:07 GMT  
 vbscript javascript question
tsk.  Details.




:: Yes; just call the function from vbscript with the variable as an
:: argument and it will be passed.
::

This was a loaded question (answered on another thread). The vbscript
variable is server side ASP and the jscript variable is client side
browser ;-)...

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Sun, 26 Dec 2004 09:52:58 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. server side vbscript /javascript question

2. vbscript / javascript question

3. VBScript to Javascript question

4. Question on VBScript and JavaScript

5. VBScript to Javascript question

6. vbscript => javascript or javascript => vbscript ?

7. How to call a macro from Vbscript or Javascript

8. Trying to call Javascript from VBscript

9. passing javascript variable into asp variable using vbscript

10. why javascript instead of vbscript?

11. JavaScript vs. VBScript

12. Passing a vbscript variable to a javascript function

 

 
Powered by phpBB® Forum Software