草庐IT

is_undefined

全部标签

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 - 从远程 repo 中拉出并获得 : "Parsing error: The keyword ' import' is reserved"

我收到以下错误:ERRORin./src/main.jserrorParsingerror:Thekeyword'import'isreserved/Users/staging/Desktop/sourcetree/viewer_web/src/main.js:1:1importVuefrom'vue'出于某种原因,我的项目中的ES6功能未被识别?我正在使用Node5.0,这是我的package.json:{"name":"istaging-viewer","description":"AVue.jsproject","author":"Alex","private":true,"sc

javascript - How to implement a Client-side Ajax Login on Asp.Net MVC (A link to the solution for Asp.Net Webforms is in here)

我正在尝试在Asp.NetMVC上实现客户端ajax登录。我以前在WebForms上设置得很好,但现在我已经转移到MVC上,这给我带来了一些麻烦。如果您想要有关Asp.NetWebforms的客户端Ajax登录的教程,可以找到here--简单,A++现在...出于某种原因,它不适用于Asp.NetMVC。除了执行ssa.login()时,我使用了与Webforms完全相同的教程(等效于:Sys.Services.AuthenticationService.login())它什么也没做。我在onLoginComplete()函数和onError()函数中都有警报。在ssa.login被调

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 - Bootstrap : Responsitive design - execute JS when window is resized from 980px to 979px

我使用的是上一个Twitter的Bootstrap。当我的窗口宽度小于980px时,我想执行某个JS函数(显示一次工具提示)(如你所知,在这个尺寸上,Bootstrap修改Navbar并隐藏标准菜单项)——窗口从768到979,简而言之.这个我知道@media(min-width:768px)and(max-width:979px){...}此选项可用于捕获事件。但是,它可能仅用于更改现有样式,例如body{background-color:#ccc;}我需要启动JS函数,或者为元素添加或删除特定样式。我试过:window.onresize=function(){if(window.o

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 - react 函数说 "is not a function"

我正在努力将一个小React应用程序分解成更小的组件。在分离代码之前,一切都按计划进行。我现在正在尝试调用一个函数onChange,它调用一个函数,然后调用一个函数作为prop。我像这样绑定(bind)函数this.updateInput=this.updateInput.bind(this);但我仍然无法弄清楚我缺少什么。我在这里(React:Passfunctiontochildcomponent)上尝试了最近的一篇文章,但错误仍然存​​在。任何帮助都很棒。这是我正在使用的代码:classWeatherextendsReact.Component{constructor(props

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