Web Analytics Made Easy -
StatCounter Mixing VBScript + Javascript? - CodingForum

Announcement

Collapse
No announcement yet.

Mixing VBScript + Javascript?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.?
    Oh, was I supposed to put something here? ........

  • #2
    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... ?

    Comment


    • #3
      Thanks, swmr. That worked great!
      Oh, was I supposed to put something here? ........

      Comment

      Working...
      X