是否可以通过oninit
回调使此函数返回textEditor?我试图将textEditor
作为参数传递给initialised()
,但只是未定义。
function magic() {
var returnMe;
function initialised() {
console.log('initialised');
//tried to set returnMe here, textEditor undefined! what!
}
var textEditor = new tinymce.Editor(element, {
...
oninit : initialised(),
...
}
});
}
答案 0 :(得分:1)
解决方案很简单:
function initialised() {
console.log('initialised');
}
function magic() {
var returnMe;
var textEditor = new tinymce.Editor(element, {
...
oninit : initialised(),
...
}
});
}