• Dynamic code

    From =?UTF-8?Q?Jonas_Th=C3=B6rnvall?=@21:1/5 to All on Fri Dec 3 22:51:11 2021
    Is eval the only way to create and execute dynamic commands? command="parent.MultiID.document.getElementById('MVOL"+track+"').value=CCvol"

    eval(command);

    Or is there a way to insert a string into a command?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to All on Sun Dec 5 13:48:11 2021
    On Fri, 3 Dec 2021 22:51:11 -0800 (PST), Jonas Thörnvall wrote:
    Is eval the only way to create and execute dynamic commands? command="parent.MultiID.document.getElementById('MVOL"+track+"').value=CCvol"

    eval(command);

    Or is there a way to insert a string into a command?

    Script element injection; function instantiation; `javascript:` protocol;
    and own JS interpreter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Haufe (TNO)@21:1/5 to jonas.t...@gmail.com on Sun Dec 5 09:20:22 2021
    On Saturday, December 4, 2021 at 12:51:16 AM UTC-6, jonas.t...@gmail.com wrote:
    Is eval the only way to create and execute dynamic commands? command="parent.MultiID.document.getElementById('MVOL"+track+"').value=CCvol"

    eval(command);

    Or is there a way to insert a string into a command?

    The correct answer is that you're doing it wrong.

    Use a function and not a string. Your command is a reference to that function.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)