草庐IT

async_read

全部标签

javascript - 未捕获的 InvalidStateError : Failed to read the 'result' property from 'IDBRequest' : The request has not finished

我需要你们的帮助。我正在使用indexedDB。我需要使用Javascript从数据库中的表中读取记录,但我收到一条错误消息,指出来自Chrome浏览器V52UncaughtInvalidStateError:Failedtoreadthe'result'propertyfrom'IDBRequest':请求未完成。下面是我的Javascript代码变量数据库;varavailableJobs=0;window.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexe

javascript - 如何处理 async/await fetch API 中的错误 404

在没有提供数据的情况下是否有机会捕获错误?我收到Error404但不能例如console.log它...classAppextendsReact.Component{getWeather=async(e)=>{e.preventDefault();constcity=e.target.elements.city.value;constcountry=e.target.elements.country.value;constapi_call=awaitfetch(`http://api.openweathermap.org/data/2.5/weather?q=${city},${cou

javascript - jQuery 用户界面 : Uncaught TypeError: Cannot read property 'display' of undefined

我正在尝试使用jqueryajax获取数据,一切正常,我得到了我想要的,但我无法显示它,因为我收到未捕获的类型错误:无法读取未定义的属性“显示”。这里是代码。有什么想法吗?/**Getthedatafromtheajaxcallanddisplayadialog*/functionCreateDialog(email){//getthedatafromtheajaxcallvarpromise=AjaxSubscribe(email)//ifdataareavailable,showthedialogpromise.success(function(data){//dataisasim

javascript - async.auto 中的任务结果

我对async.auto中从一项任务到另一项任务的结果逻辑感到困惑。.例如,在下面的代码逻辑中,我在task1中向模型添加了一些数据,它最初是initialtask的输出,在finalTask​​中添加了数据到task1中的模型也反射(reflect)在results.initialTask​​1中。task2中类似添加的数据反射(reflect)在finalTask​​中的results.initialTask​​1中。总结所有results.initialTask​​1,results.task1[0],results.task2[0]、results.task3[0]在final

javascript - 为什么 JavaScript 函数需要关键字 "async"? "await"关键字还不够吗?

关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题?更新问题,以便editingthispost可以用事实和引用来回答它.关闭6年前。Improvethisquestion例如,为什么下面的函数需要“异步”?使用await是否不够具体,编译器可以毫无歧义地解析代码?//Whydoweneedasynchere?asyncfunctionfoo(){varuser=awaitgetUser(user_id);console.log(user);}是为了向后兼容的原因吗?(我想不出在标准JavaScript中使用await键盘的任何代码...)?主要是为了清晰起

javascript - 强制定向图错误, "Cannot Read Property ' Push' of Undefined"

我是编码新手,最近开始使用d3生成力导向图。使用链接派生节点时,我成功生成了一个四节点图。但是,当我明确列出节点时,我收到错误“UncaughtTypeError:Cannotreadproperty'push'ofundefined(d3.v3.min.js)”。我研究了对以下两个类似问题的回答,但无法使用答案解决此问题。我试图尽可能多地删除不相关的功能,谢谢。JavaScripterror"UncaughtTypeError:Cannotcallmethod'push'ofundefined"D3.jsUncaughtTypeError:Cannotcallmethod'push'

javascript - 重组 "withReducer": justification of async reducer function call

我正在使用withReducerHOC并注意到这种行为:例如,在点击处理程序上调用它:importReactfrom'react'import{withReducer}from'recompose'import{compose}from'ramda'exportdefaultcompose(withReducer('state','dispatch',(state,{value})=>{console.log(value)return{...state,value}},{value:'zero'}))((props)=>{const{dispatch,state}=props,onCl

javascript - Node : Testing with sinon and async/await

使用sinon和async/await运行此测试时遇到问题。这是我正在做的一个例子://infilefuncsasyncfunctionfuncA(id){leturl=getRoute53()+idreturnawaitfuncB(url);}asyncfunctionfuncB(url){//emptyfunction}和测试:letfuncs=require('./funcs');...//describeletstubRoute53=null;letstubFuncB=null;letroute53='https://sample-route53.com/'letid='123

javascript - 未捕获的类型错误 : Cannot read property 'name' of undefined

单击“选择文件”时,我有以下代码:$(':file').change(function(){if(this.files.length==1){$('#selected_files').html("Attaching"+this.files.length+"file");}else{$('#selected_files').html("Attaching"+this.files.length+"files");}$('#selected_files').append("FilenameSize");for(x=0;x"+name+"("+filesize(size)+")"+type+"

javascript - CKEditor 4 : Uncaught TypeError: Cannot read property 'langEntries' of null

我正在为CK编辑器(https://github.com/galetahub/ckeditor)使用Rubygem,但出现此错误:UncaughtTypeError:Cannotreadproperty'langEntries'ofnull这是它在代码中出现的地方:CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){vard={};returnfunction(b,c,e){vari={},g=function(b){a.call(this,b,function(a){CKEDI