Is there any way to run a script as a string in JavaScript like this?
// core.jslib
mergeInto(LibraryManager.library, {
myCallback: function (str, arg) {
runScript(str, arg); // I want a function like this
}
});
// execute script
<script>
var script = "function(str){ window.alert(UTF8ToString(str)); }";
myCallback(script, "Hello, World");
</script>
I was wondering if it is possible to run a script in this way.