草庐IT

fcatch-undefined-behavior

全部标签

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

任何人都可以告诉我为什么会出现此错误:未捕获的类型错误:无法读取未定义的属性“替换”functioncheckNewPost(x){varpid=$('#NewPostbody').attr('class');if(pid==='post-t'){setTimeout(checkNewPost,);}else{$.ajax({type:"POST",url:"/html_postReply.php",data:"pid="+pid.replace('post-t','')+"&type=1",success:function(html){if(html){$('.tekin').app

javascript - 类型错误 : Cannot read property 'push' of undefined -Express

我已经为使用express路由和创建服务器的nodejs应用程序编写了两个Javascript文件。由于我是初学者,我对此了解不多。当我运行该应用程序时,它向我显示以下错误:-/usr/lib/node_modules/express/lib/router/index.js:472this.stack.push(layer);^TypeError:Cannotreadproperty'push'ofundefinedatFunction.use(/usr/lib/node_modules/express/lib/router/index.js:472:15)atObject.(/hom

javascript - 在 IE11 中下载文件出现错误 "' Uint8Array' is undefined”

我正在创建一个正在下载文件的应用程序。为此,我从js中的java类获得响应并下载此响应。为此,我的java代码是-@ApiOperation(value="",notes="")@Path("/getProjectJSONTODRAW/{implementation}")@GET@TimedpublicResponsegetProjectJSONTODRAW(@PathParam("implementation")Stringimplementation){Filefile=newFile(path+File.separator+fileName);InputStreaminputSt

javascript - 未捕获的类型错误 : Cannot read property 'lat' of undefined when serializing leaflet data with $. 参数()

我想先说明一下:我是JavaScript的新手。我正在尝试使用Leaflet和AJAX调用发布用户位置和map边界。在我的事件处理程序stateUpdater.onLocationFound中,日志语句打印出正确的用户坐标和map边界,但是我在尝试时得到UncaughtTypeError:Cannotreadproperty'lat'ofundefined使用$.param()序列化这些值。我正在使用Leafletv0.7.2和jQuery1.11.0。varmap;$(document).ready(function(){map=newL.map('map').setView([41

javascript - 当你在 JavaScript 中分配 undefined 时会发生什么?

考虑以下代码:varx=undefined;这是一行自相矛盾的代码。x是否定义?JavaScript的实现是从内存中删除变量x,还是给它赋值undefined? 最佳答案 变量未声明和未定义是有区别的:varx;//xisequalto*undefined*alert(y);//error,yisundeclared这并不自相矛盾,但是多余的:varx=undefined;将undefined简单地视为变量未初始化时的值–或者对象属性未初始化时的值或声明。 关于javascript-当你

javascript - findRecord 给出错误 "Cannot read property ' _internalModel' of undefined"

在我们的ember应用程序中,我们使用以下版本的ember-data和ember-data-factory-guy。包.json"ember-cli":"^1.13.8","ember-data":"1.13.9","ember-data-factory-guy":"1.13.10",注意:我们使用的是事件模型适配器,尚未迁移到json-api适配器。importActiveModelAdapterfrom'active-model-adapter';exportdefaultActiveModelAdapter.extend({路由:item.jsexportdefaultEmber

javascript - 原型(prototype) : registry is undefined

我的注册表是未定义的行:5557...原型(prototype)为1.7。$$('#pageNava').each(function(element){element.observe('click',doSome(this.href));})pageNav是带有LI和A标签的UL列表。 最佳答案 这可能不完全适用,但我有一个非常相似的问题。原来我试图附加事件处理程序的对象是未定义的。//objTblisundefined->'registryisundefined'errorEvent.observe(objTbl.rows[i],

javascript - 我有错误 document.registerElement undefined

JavaScript运行时错误:对象不支持属性或方法“registerElement”在文件中:...bower_components\polymer\polymer.js11701行document.registerElement('polymer-element',{prototype:prototype});我的凉亭:{"name":"Polymer","version":"0.0.0","main":"main","license":"MIT","private":true,"dependencies":{"polymer":"Polymer/polymer#~0.5.2","

javascript - 类型错误 : 'undefined' is not a function (evaluating '$( "#wnd_Addparam"). 对话框')

我有2个月的这个例子,我换了PC。现在这似乎不再起作用了。这是一个应该通过(之前)按下按钮来加载小窗口对话框的示例。但是,它不起作用...这是我的代码://varregex,v,l,c,b;$("#wnd_Addparam").dialog({autoOpen:false,height:'auto',width:350,modal:true,resizable:false,buttons:{"Add":function(){$(this).dialog("close");},Cancel:function(){$(this).dialog("close");}},close:funct

javascript - 绑定(bind)到 `undefined` 而不是 `null` 有什么好处

我经常看到,当需要在没有特定上下文的情况下使用绑定(bind)参数调用函数时,undefined通常比null更受欢迎上下文,如:f.call(undefined,param1,param2)优于:f.call(null,param1,param2)我想知道这是否有任何特殊原因? 最佳答案 What'sthebenefitofbindingtoundefinedinsteadofnull?我认为没有。来自10.4.3EnteringFunctionCode:Ifthefunctioncodeisstrictcode,settheTh