
VB call to JScript method returns method's source
When you call a jscript method (which is always a function), you must include the ()'s even if no arguments are passed. You use the ()'s in the sample VB code here, but I'd guess that in the real code you didn't. If you omit the ()'s then you'll get exactly what you describe.
--
Michael Harris
Hello,
In IE5, If I call a JScript method from a VB code, the return value is a
string containing the source code of the JScript method itself!
For example
JScript::
function MyObj() {
//...
this.theMethod = myMethod;
}
function myMethod() { return true; }
VB: (somehow has a ref to the above object):
Dim res as Variant
res = jsObj.theMetod()
now the res is a string: "function myMethod() { return true; }".
However if I pass an argument, it works.
res = jsObj.theMethod(Null)
Does anybody have a rationale?
regards,
--VS.