问题标签 [kanso]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
jquery - $.couch.db().openDoc() 和 db.getDoc 是异步的,对吧?
尝试调用主题的方法并且效果很好,我从方法中请求的文档中获得了所需的任何信息。现在我想在方法之外使用该信息,并且每当我尝试该变量出来时undefined
。
从我所读到的这些方法是asynchronous
结果undefined
。
那么,如何解决呢?做$.ajax({.. async:false..})
一种违背目的的工作,* a *jax 是 * a *sync。除了 Q&Dasync:false
选项,还有什么建议吗?