Atozed Forums

Full Version: passing Delphi variable to javascript variable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Is there a way to pass Delphi var to a javascript variable?

I know that I can call WebApplication.CallBackResponse.AddJavaScriptToExecute 
to execute a javascript function and pass it the actual string (i.e. value of the variable).

But if I don't want to expose the contents of the delphi variable in html/javascript, 
how do I pass it?

Thanks,
Joe
I need a little more context. You can just declare a variable in Javascript using AddJavaScriptToExecute(), and then use it anywhere.

Like: WebApplication.CallbackResponse.AddJavaScriptToExecute('var myvariable = "abcd"');

and it will be available while this page is active.