VBscript to write javascipt function that pass arguments

by Ranganathan 2012-08-29 00:07:47

This example is much simplified as the original script.

VBScript is making a value, passes this to Javascript, which puts that value into a div tag.
Now, as you see in the VBScript, the value contains a call to a javascript function. It shows perfectly in HTML, but the call can't be made when clicking the link.

Is it possible in VBscript to write dynamic hardcoded javascipt function that pass arguments?

<script type="text/vbscript">
Dim m
m = "my message"
message = "
sendtojs(message)
</script>


HTML Code:

<script type="text/javascript">
function sendtojs(message){
var messContainer = document.getElementById("messages");
messContainer.innerHTML = message;
}

function test(m){
alert(m);
}
</script>

HTML:
<div id="messages"></div>


804
like
0
dislike
0
mail
flag

You must LOGIN to add comments