From here we have two approaches: to Eval the function code or to create “Script” element dynamically.
First approach is very straightforward:
Second approach is pretty much of the same, but creates a real “Script” block in the document’s body:
Now all we have to do is execute the function:
That’s it… Running application here:
Sure this application is pretty simple and unsecure, but this is only a demo and could be enriched with any needed functionality.
p.s. Noam – many thanks for idea 😉