You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-user@tcl.apache.org by Wim Wan <ww...@sigma-rt.com> on 2006/03/06 05:01:22 UTC
How can I pass parameters to My TCL proc in JavaScript Code?
Hi:
I am Wim. Please Help me!!!
(Considering I am from China...)
Example:
web::puts {<script>
function foo() {
var strArg1 = "wim";
var iArg2 = 2;
// invoke my TCL proc
// How can pass strAgr1 and iArg2 to myProc
{myProc ????????????????????}
}
</script>}
proc myProc {arg1 arg2 }{
#do something with arg1 arg2
}
Wim Wan
2006-03-06
Re: How can I pass parameters to My TCL proc in JavaScript Code?
Posted by Ronnie Brunner <ro...@netcetera.ch>.
Hi
> I am Wim. Please Help me!!!
> (Considering I am from China...)
What does your question have to do with China?
> Example:
>
> web::puts {<script>
> function foo() {
> var strArg1 = "wim";
> var iArg2 = 2;
> // invoke my TCL proc
> // How can pass strAgr1 and iArg2 to myProc
> {myProc ????????????????????}
> }
> </script>}
>
> proc myProc {arg1 arg2 }{
> #do something with arg1 arg2
> }
You can't: Websh will be executed on the server and Javascript on the
client.
btw: web::put (not web::puts) will just output your code (here the
JavaScript function foo(), where as web::putx will eval the code in
curly brackets. But neither does what you want, because it both
happens on the server and there is *no* Websh on the client.
hth
Ronnie
--
Ronnie Brunner | ronnie.brunner@netcetera.ch
phone +41 (0)44 247 79 79 | fax +41 (0)44 247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-user-help@tcl.apache.org