Skip to content Skip to sidebar Skip to footer

Pass And Return Value From Javascript To Vbscript, Vice Versa In Asp

My code is below, I would like to make this work because my existing webpage that I am working at mostly uses VBScript. I am using ajax to query values to SQL. I would hate to chan

Solution 1:

It is possible.

You have 2 issues in your script.

  • Your Script tag for vbscript does not have </script>
  • retValue is a function. you need to pass the arguments with in ( )

I tried to call check & it shows the msgbox with the text 2

<SCRIPTLANGUAGE="VBSCRIPT">
    Sub check()
        Dim a
        Dim b
        a = 1
        b = retValue(a)
        MsgBox b

    End Sub

    </script><SCRIPTLANGUAGE="JavaScript">functionretValue(a){
        return a + 1;
    }
    </SCRIPT>

Post a Comment for "Pass And Return Value From Javascript To Vbscript, Vice Versa In Asp"