Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass Nothing from Javascript to VBScript in IE9

Unfortunately, you are probably stuck here - JavaScript does not have a "Nothing" equivalent. See This Article for more information.

[Edit] However, the following may work. In your VBScript create a function called "GetNothing" that returns "Nothing". In your JavaScript use "var jsNothing = GetNothing()". Comes from this article


This question is fascinating, I thought I'd try and answer it just for the fun of it.

(Congrats to mixel on getting a better job!)

I don't have access to IE right now, so I can't test this, but what if you tried writing a function like this:

<script type="text/vbscript">
  Function CallWithNulls(fn, arg1, arg2, arg3)
    If (isNull(arg1)) arg1 = Nothing
    If (isNull(arg2)) arg2 = Nothing
    If (isNull(arg3)) arg3 = Nothing
    fn(arg1, arg2, arg3)
  End Function
  Function IsNothing(arg1, arg2, arg3)
     return arg1 is Nothing
  End Function
</script>
<script type="text/javascript">
  alert(CallWithNulls(IsNothing, null, 1, 2));
</script>

Of course I don't know if VB script allows calling functions like that... and you'd have to deal with more/fewer arguments.