草庐IT

is_undefined

全部标签

javascript - d3 : what is the self as in d3. select(self.frameElement).style ("height", height + "px");

我在许多D3示例中看到过如下语句。但是,我无法找出它的含义。特别是,我不知道这个self变量指的是什么。此外,这是否体现了某种D3魔术/惯例,或者它只是一个临时的东西?非常感谢。d3.select(self.frameElement).style("height",height+"px");顺便说一句,here是我复制上面语句的例子。 最佳答案 self:如果没有重新定义(通常作为this的副本),那么它就是始终指向windowwindow对象。因此它们可以互换使用。window.frameElement:返回嵌入窗口的元素(例如或

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 - 无效值错误 : initAutocomplete is not a function Google Places and Autocomplete API

希望您能提供帮助,因为我遇到了困难,我对使用Google的PlacesAPI也很陌生。我现在不打算发布任何代码,因为当我将要描述的2部分独立运行时,我的代码工作正常。除了使用Google提供的Javascript示例的自动完成API之外,我还使用Google的Places。最初我的文档底部有以下脚本:我文档顶部的这个脚本:这让我想到,“您已在此页面上多次包含GoogleMapsAPI。这可能会导致意外错误。”所以在研究了这个之后,我像这样将两者合并在一起:但是,既然我已经这样做了,我会收到以下错误:InvalidValueError:initAutocompleteisnotafunc

javascript - 对所有包含 "undefined” 的不存在页面的请求

自2014年10月20日起,我们的日志中出现了一些奇怪的请求。它们已经增加到每天大约几十个,所以虽然不是什么大问题,但找出原因仍然很有趣。早期的:REQUEST[/en/undefinedsf_main.jsp?clientVersion=null&dlsource=null&CTID=null&userId=userIdFail&statsReporter=false]REFERER[http://colnect.com/en/coins]REQUEST[/fr/undefined/GoogleExtension/deals.html?url=http://colnect.com&s

javascript - '类型错误 : undefined is not a function' when jumping 'tween modules

我在Node中不断遇到这个问题,每当我相互调用函数时,我的应用程序就会崩溃。我已经做了这个最小的工作示例(按照它的方式工作给了我错误):启动模块varmodule2=require('./module2');vardata='data';module2.doStuff(data);模块2varmodule3=require('./module3');functiondoStuff(data){//Stuffhappensto'data'module3.takeStuff(data);}functiondoSomethingElse(data){console.log(data);}mo

javascript - 为什么 typeof let === 'undefined' ?

为什么typeoflet返回'undefined'而不是抛出SyntaxError?console.log(typeoflet);一元typeof运算符需要一个表达式。我是否遗漏了有关let语句的内容? 最佳答案 typeof运算符将let视为未声明的变量。查看更多信息MDNdocs.用一个未声明的变量看这个。console.log(typeofelefromstack)在严格模式下,会抛出一个错误。'usestrict'console.log(typeoflet); 关于javascr

javascript - react .js : Is it possible to namespace child components while still using JSX to refer to them?

假设我有一个名为ImageGrid的组件定义如下:window.ImageGrid=React.createClass({render:function(){return();}});如您所见,它包含一个名为ImageGridItem的子React组件。.其定义如下。window.ImageGridItem=React.createClass({render:function(){return(something);}});只要两者都是window的直接属性,这就可以正常工作.但这有点可怕,所以我想将我所有的react组件分组到window.myComponents的命名空间下。例如。

javascript - 类型错误 : module is not a function AngularJS & Jasmine

在我的示例应用程序中,我像这样测试运行器收藏夹Controller:varmodule=angular.module('AngularSampleApp',[]);varFavoritesController=module.controller('FavoritesController',functionfavoritesController($scope){$scope.phones=[{'name':'NexusS','snippet':'FastjustgotfasterwithNexusS.'},{'name':'MotorolaXOOM™withWi-Fi','snippet

javascript - vscode : [ts] Experimental support for decorators is a feature that is subject to change

我得到“[ts]对装饰器的实验性支持是一项功能,在未来的版本中可能会发生变化。设置'experimentalDecorators'选项以删除此警告。”我是Angular的新手,我不知道如何解决它。我的tsconfig.json文件:{"compilerOptions":{"allowSyntheticDefaultImports":true,"declaration":false,"emitDecoratorMetadata":true,"experimentalDecorators":true,"lib":["dom","es2015"],"module":"es2015","mod

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

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