I need to run following code
document.getElementById("someID").focus();
after below code
setTimeout(function(){loadEditor(param);}, 50);
But i am unable to make it asynchronous.Since I can not modify
function loadEditor(param){ /* some stuff */ }
Is there anyway out to do this? What I have tried till now
setTimeout(function(){
loadEditor(param);
document.getElementById("someID").focus();
}, 50);
and
setTimeout(function(){
$.when( loadEditor('question_stem-text') ).done(function() {
document.getElementById("someID").focus();
});
}, 50);
Not successful
loadEditordo?console.log()to check if it gets called?loadEditorimplements a callback call after it's done (I believe it's async, so it should in theory). Otherwise you should editloadEditorand add a callback call when it's done.