草庐IT

undefined-index

全部标签

javascript - 为什么 'Infinity' 、 'null' 、 'NaN' 和 'undefined' 的大小写不一致?

在JavaScript中,语言构造“Infinity”、“null”、“NaN”和“undefined”的大小写不一致。它是历史性的,还是背后有某种意图? 最佳答案 没有人知道。:-((以下是原始答案)纯粹的猜测,但是......null和undefinedare是一个JavaScript关键字s,反射(reflect)了各种“非值”元数据。我知道的所有关键字都是小写的(c.f.true,false);undefined是代表甚至更多元数据的全局属性;Infinity和NaN是反射(reflect)IEEE浮点标记值的全局属性,并且

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

尝试将reactrouterv4与redux一起使用并遇到此错误,似乎是在遵循文档,但在任何地方都找不到任何信息,所以我不知所措:UncaughtTypeError:Cannotreadproperty'route'ofundefined这是我的代码:importReact,{Component}from'react';import{BrowserRouterasRouter,Route,Link,withRouter}from'react-router-dom'importMenufrom'./Menu';import{connect}from"react-redux";import

javascript - 为什么 Lodash 中的 isNil 方法使用 null 而不是 undefined?

为什么Lodash中的isNil方法使用null而不是undefined?functionisNil(value){returnvalue==null;} 最佳答案 就逻辑而言,使用null或undefined作为null==undefined==true没有区别,但是使用null而不是undefined会使文件大小减少5个字节。这样做只是为了节省几个字节,使文件更小,更快从服务器下载。 关于javascript-为什么Lodash中的isNil方法使用null而不是undefined?

javascript - Highcharts.js 不会呈现图表,它表示错误 "Cannot read property ' 系列' of undefined”

我认为这是因为当我的函数requestData被调用时我的全局varchart还没有设置。这是我在$(document).ready(function()中的highcharts代码chart=newHighcharts.Chart({chart:{renderTo:'container',defaultSeriesType:'spline',marginRight:130,marginBottom:25,events:{load:requestData()}},title:{text:'ReportePMU',x:-20//center},subtitle:{text:'',x:-2

javascript - 未捕获的类型错误 : undefined is not a function - typeahead. js

我正在尝试获得一个基本的typeahead.jsexample上类。如果我在单独的HTML文件中创建该示例,如下所示。$(document).ready(function(){varsubstringMatcher=function(strs){returnfunctionfindMatches(q,cb){varmatches,substringRegex;//anarraythatwillbepopulatedwithsubstringmatchesmatches=[];//regexusedtodetermineifastringcontainsthesubstring`q`su

javascript - 变量抛出 'undefined' 错误,无法弄清楚

我正在使用Raphael.js。每次我加载页面时,我都会收到一条错误消息:conisundefinedx=con.x我在Raphael文档中查找了con,这是我发现的:varcon=R._getContainer.apply(0,arguments),container=con&&con.container,x=con.x,y=con.y,width=con.width,height=con.height;//...con在这里明确定义。这是我要加载的代码:varpaper=newRaphael(ele('canvas_container'),500,500);window.onloa

javascript - 未捕获的类型错误 : undefined is not a function rails3/backbone/js

我刚刚开始研究javascript以使项目更具响应性,并且我正在研究一个backbone.js示例。我已经复制了http://www.jamesyu.org/2011/01/27/cloudedit-a-backbone-js-tutorial-by-example/在一个新的Rails3项目中。我运行该项目并转到主页....那里有一个指向/#的链接,没有其他任何内容。查看js控制台,我在两个脚本上遇到错误:application.js和backbone.js这个(backbone.js)backbone-min-0-3-3.js:8UncaughtTypeError:Cannotca

javascript - D3.js : Uncaught TypeError: Cannot read property 'document' of undefined

我在d3.js初始化方面遇到了一个非常奇怪的问题。在d3.js脚本中,一开始它尝试获取vard3_document=this.document;但它弹出以下错误:UncaughtTypeError:Cannotreadproperty'document'ofundefined调试时,this.document返回未定义。我正在使用yowebapp生成项目。它使用bower作为包管理器,并使用gulp进行构建过程(使用babel实现ES2015功能)。有趣的是,我已经用xampp对其进行了测试,它运行良好!我会很感激一些建议!谢谢! 最佳答案

javascript - 方法 Set.prototype.add 在不兼容的接收器上调用 undefined

我根本不明白为什么会出现这个错误。这是我在chrome的控制台上测试的内容:>varmySet;mySet=newSet;mySet.add('foo','bar','baz')//Workedasexpected['bar','baz'].forEach(mySet.add)X->VM1529:1UncaughtTypeError:MethodSet.prototype.addcalledonincompatiblereceiverundefined(…)提前致谢。 最佳答案 在这种情况下,当您将add方法作为回调传递时,它会丢失

javascript - 又一个 'Uncaught TypeError: Cannot call method ' apply ' of undefined '

我的机会很小,但我已经通过Google尝试了几个解决方案,但似乎没有任何方法可以解决“UncaughtTypeError:Cannotcallmethod'apply'ofundefined”,匿名函数:如果单独没有其他JS,它可以工作,但是当与其他脚本组合在同一页面上时,我会收到错误。它引用的代码行如下,第32行是罪魁祸首。第32行是这一行-if(resizeTimeout){clearTimeout(resizeTimeout);:var$event=$.event,resizeTimeout;$event.special.smartresize={setup:function()