草庐IT

READ_CALL_LOG

全部标签

javascript - 未捕获的类型错误 : Cannot read property 'then' of undefined using Sweet Alert

我正在使用SweetAlert2我收到以下错误UncaughtTypeError:Cannotreadproperty'then'ofundefined当我使用与SweetAlert页面中建议的完全相同的代码时。swal({title:'Areyousure?',text:"Youwon'tbeabletorevertthis!",type:'warning',showCancelButton:true,confirmButtonColor:'#3085d6',cancelButtonColor:'#d33',confirmButtonText:'Yes,deleteit!',canc

javascript - 将数组缓冲区转换为字符串 : Maximum call stack size exceeded

这是我的代码。varxhr=newXMLHttpRequest();xhr.open('GET',window.location.href,true);xhr.responseType="arraybuffer";xhr.onload=function(event){debugger;console.log("covertingarraybuffertostring");alert(String.fromCharCode.apply(null,newUint8Array(this.response)));};xhr.send();该请求是针对大小约为3MB的PDFURL发出的。我读过几

javascript - 未捕获的 RangeError : Maximum call stack size exceeded, JavaScript

我有一个问题open:function($type){//Somecodedocument.getElementById($type).addEventListener("click",l.close($type),false);},close:function($type){//Thereissomecodetoodocument.getElementById($type).removeEventListener("click",l.close($type),false);//^Recursion&UncaughtRangeError:Maximumcallstacksizeexce

javascript - bunyan log.child 正确的用例?

我一直在寻找用于登录我的nodejs应用程序的bunyan。我试过了,一切似乎都运行良好。我跳过了asection在log.child上,但现在我正试图了解如何使用它。我认为它的目的是允许我为日志条目指定一些特殊标识符,以便我可以唯一地标识该日志与其他日志条目的关联方式。如果是这样的话,我会设想自己在每个请求中都使用log.child:varbunyan=require('bunyan');varlog=bunyan.createLogger({name:'myapp'});router.post('/submit',function(req,res){varlogChild=log.

javascript - 我怎样才能 console.log() 一个 Blob 对象?

我有一个Blob对象,我想通过记录它的值来检查它。我只能看到type和size属性。有办法做到这一点吗? 最佳答案 使用FileReader的基本示例查看blob中的内容varhtml=['HelloWorld'];varmyBlob=newBlob(html,{type:'text/xml'});varmyReader=newFileReader();myReader.onload=function(event){console.log(JSON.stringify(myReader.result));};myReader.rea

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

我有一个插件可以访问许多元素的length属性。但是,javascript控制台指向jquery.min.js的第12行。我如何回溯以找到我的插件中有问题的行? 最佳答案 如果您使用缩小的脚本,任何调试器(例如完全最好的Firebug)都会向您显示相同的问题行,并且此信息毫无用处(缩小的脚本难以阅读和理解,并且它们写在一行中)。解决此类问题的几种方法:正如我之前所说:为了开发而不是缩小脚本,调试器会向您显示有意义的行,如果您幸运的话,您可以找到非常有用的开发人员评论。如果找不到完整版本的脚本,请使用像这样的unminifier:ht

javascript - jQuery 中的 "Uncaught TypeError: cannot read property ' 长度 ' of null"

我正在定义在我的HTML上按下按钮时发生的以下操作:$(document).ready(function(){$("#query").keydown(function(){//stuff$.get(url,function(result){console.log(result);varlist="";for(vari=0,l=result["results"].length;i'+result["results"][i]["label"]+'';}list="Herearesomeresults:"+list+"";});});到达“结果”的是一个JSON数组,格式如下:{"resul

javascript - 为什么 Angular 5 Transition 抛出 AppComponent.html :2 ERROR TypeError: Cannot read property 'forEach' of undefined

为什么Angular5会抛出这个错误?AppComponent.html:2ERRORTypeError:Cannotreadproperty'forEach'ofundefined我正在研究Angular动画的概念验证,我直接使用网站上的代码。我的组件如下所示:import{Component,OnInit}from'@angular/core';import{trigger,state,style,transition,animate,keyframes}from'@angular/animations';@Component({selector:'app-obj-list',te

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

关闭。这个问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭4年前。Improvethisquestion升级到16.x后出现以下错误UncaughtTypeError:Cannotreadproperty'injection'ofundefinedatinjectTapEventPlugin(injectTapEventPlugin.js:23)ateva

javascript - 为什么在 log 之后声明的内部函数中有相同的变量名时,内部函数中的变量返回 nan

这个问题在这里已经有了答案:Whydoesshadowedvariableevaluatetoundefinedwhendefinedinoutsidescope?(6个答案)'Hoisted'JavaScriptVariables(7个答案)关闭3年前。这里发生了什么?如果我在内部函数中的console.log之后声明一个变量,我会得到不同的结果我知道var有一个功能范围,内部函数可以从它们的父级访问变量functionouter(){vara=2;functioninner(){a++;console.log(a)//logNaNvara=8}inner()}outer()func