Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
passing Delphi variable to javascript variable

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?

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.

Forum Jump:

Users browsing this thread: 1 Guest(s)