jjzjj

something_undefined

全部标签

javascript - Socket.configure Undefined is not a function 错误

注意:我使用的是MacOS10.10Yosemite重要说明:其他问题和答案均对我无效。我正在学习教程,这样我就可以玩多人游戏了。有一个文件,我必须下载,其中有一个game.js文件,我需要将此代码添加到:注意:我在正确的目录中正确下载了socket.io。varutil=require("util"),io=require("socket.io").listen(80);varsocket,players;functioninit(){players=[];socket=io.listen(8000);socket.configure(function(){socket.set("t

javascript - 类型错误 : Cannot read property 'error' of undefined on React Chrome Extension

我正在使用React-Chrome-Reduxlibrary开发ReactChrome扩展我是第一次用这个开发,一直卡在错误中,不知道是什么原因。我的弹出式应用程序在运行时失败,并在控制台上显示以下错误消息:Errorineventhandlerfor(unknown):TypeError:Cannotreadproperty'error'ofundefined我尝试调试并在错误的确切位置设置断点:returnnewPromise(function(resolve,reject){chrome.runtime.sendMessage({type:_constants.DISPATCH_

javascript - Async/Await with Request-Promise 返回 Undefined

我有两个文件;server.js和scrape.js,下面是它们当前的代码片段。服务器.js:constscrape=require("./scrape");asyncfunctionstart(){constresponse=awaitscrape.start();console.log(response);}start();和scrape.js:constcheerio=require("cheerio");constrequest=require("request-promise");go=async()=>{constoptions={uri:"http://www.somew

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

我正在研究分页,我正在使用DataTables插入,在某些表上它可以工作,但在某些表上它会出错:UncaughtTypeError:Cannotreadproperty'aDataSort'ofundefined我的页面脚本如下:$(document).ready(function(){$('.datatable').dataTable({"scrollY":"200px","scrollCollapse":true,"info":true,"paging":true});});//HTML代码不知道问题是怎么来的,我知道这是很常见的错误,但我搜索并没有找到任何支持我的问题的东西。有谁

javascript - npm outdated -g Error 'Cannot read property ' length' of undefined'

我正在尝试确定我的npm安装的全局包的版本状态。在终端中运行npmoutdated-g--depth=0后,我收到此错误:npmERR!Cannotreadproperty'length'ofundefinednpmERR!Acompletelogofthisruncanbefoundin:npmERR!/Users/dangranger/.npm/_logs/2019-03-14T21_58_37_962Z-debug.log/Users/dangranger/.npm/_logs/2019-03-14T21_58_37_962Z-debug.log的内容0infoitworkedi

javascript - 附加到URL的"undefined"和"cache/xxx"

首先,我认为这和"undefined"randomlyappendedin1%ofrequestedurlsonmywebsitesince12june2012差不多是一个问题,但是由于我是新用户,因此无法对此帖子发表评论,并且还没有解决方案,所以我只能提出一个新问题。自2012年6月12日14:22EET(发生第一个错误的那一刻)起,我们遇到了非常奇怪的问题:不到1%对我们网站的请求的末尾附加了“undefined”字符串,或替换了网址的有效部分,并且引荐来源网址是指向该网站的完全有效的网址。例如,我们收到带有引荐来源http://example.com/foo/undefined的

javascript - 回调返回 undefined 与 chrome.storage.sync.get

我正在构建Chrome扩展程序并编写了这段代码。varOptions=function(){};Options.prototype={getMode:function(){returnchrome.storage.sync.get("value",function(e){console.log(e);//itprints'Object{value:"test"}'.returne;});},setMode:function(){chrome.storage.sync.set({"value":"test"},function(e){})}}varoptions=newOptions()

Javascript !undefined 是真的吗?

当我尝试警告具有undefined值的变量的否定时,我得到的输出为真?alert(undefined);alert(!undefined);第一个警报给出undefined,第二个警报给出true。这是预期的行为吗?如果是这样,那为什么?我是否遗漏了一些关于Javascript中的undefined的概念/理论? 最佳答案 Isthistheexpectedbehavior.是的。Ifsothenwhy?AmImissingsomeconcept/theoryaboutundefinedinJavascript?JavaScript

javascript - Moment.js : Uncaught TypeError: Cannot read property 'defineLocale' of undefined at moment. js:13

当运行下面的小html文件时,我看到以下控制台日志错误:moment.js:13UncaughtTypeError:Cannotreadproperty'defineLocale'ofundefinedatmoment.js:13atmoment.js:9atmoment.js:10JSBinvarnow=moment()console.log(now);我还尝试用这个CDN链接替换对本地库的引用:https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/locale/af.js有人知道这个错误是什么吗?

javascript - 'undefined' 不是在 Safari 中评估 el.click() 的函数

我想在按下Enter按钮时运行一个js函数。在IE、Chrome和Opera中一切正常,但在Safari中出现错误(如下所述)。我需要一个纯Javascript解决方案,不是jQuery。这是函数:functionpressSearch(e){if(typeofe=='undefined'&&window.event){e=window.event;}varcharCode=(e.which)?e.which:((e.charCode)?e.charCode:((e.keyCode)?e.keyCode:0));if(charCode==13){document.getElementB