Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将匿名函数放入对象/变量中并将其存储以供以后调用?
假设我有这个 JS:
callMeLater = function(){var foobar = "baz!";}
我怎样才能callMeLater从我的存储QScriptValue object? object.toString(),以便我engine.evaluate以后可以喂它,遗憾的是不起作用。我可以简单地从 JS 内部填充callMeLater一个字符串,但这感觉不对。
callMeLater
QScriptValue object
object.toString()
engine.evaluate