草庐IT

connection_properties

全部标签

javascript - 测试套件无法运行 TypeError : Cannot read property 'default' of undefined

我正在尝试在我的react-native项目上设置Jest,但它与bugsnag-react-native配合得不好.在我当前的测试配置中,我看到了与bugsnag的leaveBreadcrumb函数相关的错误,如下所示:FAILapp/__tests__/NetworkReducer.test.js●TestsuitefailedtorunTypeError:Cannotreadproperty'default'ofundefinedatObject.(app/__tests__/NetworkReducer.test.js:10:20)atGenerator.next()atPro

javascript - Connect 不能与 Redux-react 中的 StateLess 组件一起使用

我正在从其他组件调度一个Action,并且商店正在使用svgArr属性进行更新,但是尽管以下无状态组件connect'ed到商店,当svgArr的存储更改时,它不会更新。作为无状态组件,它应该如何表现?还是我做错了什么?constLayer=(props)=>{console.log(props.svgArr);return(hi);};connect((state)=>{return{svgArr:state.svgArr};},Layer);exportdefaultLayer; 最佳答案 您似乎正在导出Layer而不是Laye

javascript:class.property 与 class.prototype.property 模拟静态属性

我一直在尝试在javascript中模拟静态属性。在几个地方已经提到,class.prototype.property在所有继承自该类的对象中都是静态的。但我的POC另有说法。请看一下:使用Class.prototype.property//EmployeeclassfunctionEmployee(){this.getCount=function(){returnthis.count;};this.count+=1;}Employee.prototype.count=3;varemp=[],i;for(i=0;i我的问题#1:如果这是静态的,那么count的值不应该是4、5、6等,因

javascript - Internet Explorer 11 : Object doesn't support property or method 'isInteger'

我在InternetExplorer控制台中遇到此错误“对象不支持属性或方法‘isInteger’”,我该如何解决?代码:functionverificaNota(nota){if(nota.length>0){vararr=[];if(nota.indexOf(".")!=-1){returnferificareArrayNote(nota.split('.'));}elseif(nota.indexOf(",")!=-1){ferificareArrayNote(nota.split(','));}elseif(nota.length0){returntrue;}else{retu

javascript - 无法解析数据表 SCRIPT5007 : Unable to set property '_DT_CellIndex' of undefined or null reference

我无法解决以下数据表错误:SCRIPT5007:Unabletosetproperty'_DT_CellIndex'ofundefinedornullreference我试图在整个互联网上寻找并找到了this成为最好的解决方案。但我仍然无法解决这个问题。我在这里错过了什么吗?我是JavaScript的新手。 最佳答案 基本上这个问题是因为th到td的未匹配计数而出现的。确保与td匹配的次数。希望这对您有所帮助。 关于javascript-无法解析数据表SCRIPT5007:Unablet

javascript - JqueryUI 日期选择器 : Uncaught TypeError: Cannot read property 'settings' of undefined?

我正在开发一个asp.netMVC4项目,我在其中使用了大量的JqueryUIdatepicker。对于我的一个日期选择器,当我尝试点击日期选择器图像时出现一些错误,例如,UncaughtTypeError:Cannotreadproperty'settings'ofundefinedjquery-ui-1.10.3.min.js:9HTMLJavascriptvarcurrentDate=newDate();$("#tsDte").datepicker({dateFormat:'yy-mm-dd',maxDate:0,changeYear:true}).attr('readonly'

javascript - 我可以捕获 "can' t establish a connection"失败的 websocket 连接错误吗?

我需要测试是否已建立与我的websocket服务器的连接。此时,我可以连接到服务器,但我希望能够捕捉到该服务器不可达的可能性,所以这个问题是关于当websocket连接无法建立或超时时该怎么办出。仅使用Firefox中的基本websocket代码,它将在大约20秒后超时并调用我的错误处理程序。但它也会抛出一个JavaScript错误(至少对我使用Firebug而言)出现在浏览器中。然后日志显示:Firefoxcan'testablishaconnectiontotheserveratws://192.168.0.1/.到目前为止我尝试了什么:通过添加我自己的window.timeout

javascript - 未捕获的类型错误 : cannot read property 'replace' of undefined In Grid

我是KendoGrid和KendoUI的新手。我的问题是如何解决此错误UncaughtTypeError:Cannotreadproperty'replace'ofundefined这是我在KendoGrid上的代码$("#Grid").kendoGrid({scrollable:false,sortable:true,pageable:{refresh:true,pageSizes:true},dataSource:{transport:{read:{url:'/Info/InfoList?search='+search,dataType:"json",type:"POST"}},p

javascript - 类型错误 : Attempted to assign to readonly property

我在为指令编写测试时遇到了这个错误(使用generator-angular-module):src/capitalize.js:'usestrict';angular.module('jviotti.string',[]).filter('capitalize',function(){returnfunction(input){returninput.replace(/\w\S*/g,function(txt){returntxt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase();});};});测试/规范/capitalize.j

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

当我尝试从AJAX调用中获取数据并在单击提交按钮时将其插入另一个函数时,如何避免出现以下错误?ajax函数中的console.log调用显示数据已被抓取,我希望然后存储在json_data中。当时的目的是使用此数据来更改通过HTML表单提交的字符串。然后在“点击”函数的行返回错误:console.log(json_data.length);TestForm#results_box{border:red5pxsolid;}#place{border:#cccccc1pxsolid;}$(document).ready(function(){varjson_source="https://