Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Location
    Port Huron, MI, U.S.A.
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Mixing VBScript + Javascript?

    Is it possible to mix javascript and VBScript universal variables?
    For example,
    Code:
    <script language="VBScript">
    <!--hide 
    thing=inputbox('Type something!','here')
    //-->
    </script>
    
    <script language="Javascript">
    <!--hide 
    document.write(' '+thing+' ')
    //-->
    </script>
    I am obviously not as skilled in VBScript as JS, but is the above code possible through universal variables etc.?

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Posts
    638
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No global variable seems to be necessary; just an argument (and having the JS block above the VBS block).

    Code:
    <script language="JScript">
    <!--hide 
    function toJS(text){
    if(text){
    document.write(text);}
    }
    //-->
    </script>
    
    <script language="VBScript">
    <!--hide 
    Dim text
    text = InputBox("Type something!","here")
    toJS(text)
    //-->
    </script>
    hmm... ?

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Location
    Port Huron, MI, U.S.A.
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    Thanks, swmr. That worked great!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •