草庐IT

undefined-symbol

全部标签

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()

javascript - 为什么 undefined == undefined 但 NaN != NaN?

这个问题在这里已经有了答案:WhatistherationaleforallcomparisonsreturningfalseforIEEE754NaNvalues?(12个答案)关闭8年前。我想知道为什么undefined==undefined但是NaN!=NaN。

javascript - 什么是 'global symbol registry' ?

varsym=Symbol();是window['sym'],它已经是全局作用域。但是MDN说:TheabovesyntaxusingtheSymbol()functionwillnotcreateaglobalsymbolthatisavailableinyourwholecodebase.Tocreatesymbolsavailableacrossfilesandinaglobalscope-likeenvironment,usethemethodsSymbol.for()andSymbol.keyFor()tosetandretrievesymbolsfromtheglobals

javascript - 将 `undefined` 传递给 bind() 是什么意思?

我正在阅读一些关于bind()的文档JavaScript中的函数。其中一个例子是这样开始的:functionlist(){returnArray.prototype.slice.call(arguments);}varlist1=list(1,2,3);//[1,2,3]//CreateafunctionwithapresetleadingargumentvarleadingZeroList=list.bind(undefined,37);varlist2=leadingZeroList();//[37]所以我的问题是:这里把(undefined,37)传给bind()到底是什么意思?

javascript - 未捕获的类型错误 : Cannot use 'in' operator to search for 'scrollLeft' in undefined

根据jQueryAPIDocumentation以及此处找到的一些示例,scrollLeft是animate()的有效参数。但是,我不断收到此错误UncaughtTypeError:Cannotuse'in'operatortosearchfor'scrollLeft'inundefined。$('#preva,#nexta').click(function(){$(window).animate({scrollLeft:500},1000);});我忽略了一些简单而愚蠢的事情吗?我究竟做错了什么?谢谢:) 最佳答案 窗口没有滚动条