我有这个问题-执行此功能时
function(){
var after = function(){
server.executescript("scriptname")
};
var before = function (callback) {
server.executescript("scriptname2")
callback();
};
before(after);
}
脚本执行是随机的,而不是我期望的:
我想念什么?
谢谢!
答案 0 :(得分:0)
这似乎可行
function(){
function after(){
server.executescript("scriptname");
}
function before(){
return new Promise((resolve, reject)=>{
server.executescript("scriptname2");
resolve();
});
}
before().then(after);
}
谢谢大家的参与!
答案 1 :(得分:-1)
您看到的订单是预期的订单:
var after = async function() {
await console.log("scriptname");
};
var before = async function (callback) {
await console.log("scriptname2");
callback();
};
before(after);