jjzjj

something_undefined

全部标签

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 - 窗口对象 (window.something = something) 在 JavaScript 中做什么?

我不知道你是否需要查看完整代码,但我已经看到一些插件可以做到这一点:window.dataValidate=dataValidate这是否将“dataValidate”添加到窗口对象,或者它是如何工作的? 最佳答案 Doesthisadd'dataValidate'tothewindowobject是的,会的。例如,如果您在另一个范围内;functionfoo(){varbar=4;window.bar=bar;}您现在已经将bar设为全局,并且可以从任何地方访问它。如果没有window.bar=bar,您只能在foo()中访问它。

javascript - rails link_to : Do something after confirmation

我正在尝试使用link_to通过AJAX执行保存操作:我希望将链接替换为Saving...确认后,但无法找到一种干净的方法。现有解决方案的问题:禁用:如果我添加:disable_with=>'Saving...'链接的内部HTML将被替换,而不是链接本身。不想这样。点击:如果我添加:onclick=>"$(this).replaceWith('Saving...');"链接将立即被替换,即使用户取消确认是否有适合Rails3UJS最佳实践的解决方案? 最佳答案 你可以使用钩子(Hook)ajax:beforeSend:$('a#my

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

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

javascript - AngularJS $cookies.get() 总是返回 undefined

我正在使用AngularJS1.4.0和$cookies服务。以下代码将始终打印出一个空对象:(function(){varapp=angular.module("user-cookies-service",[]);app.service('UserCookiesService',["$cookies",function($cookies){$cookies.put("Hello","World");console.log($cookies.getAll());}]);})();我试过:使用AngulerJS1.3.15和$cookieStore,当浏览器刷新时cookie不会持续存在

javascript - 错误 : Invalid value for <g> attribute transform ="translate(undefined,undefined)"

我在集群中遇到d3.js问题。它给了我以下错误:Error:Invalidvalueforattributetransform="translate(undefined,undefined)"我不知道为什么它会给我。代码:varloadd3=function(){functionelbow(d,i){return"M"+(d.source.y+100)+","+d.source.x+"V"+d.target.x+"H"+(d.target.y+100);}varwidth=(window.innerWidth-100),height=(window.innerHeight-20);va

javascript - 为什么分配给 `NaN` 或 `undefined` 会导致 TypeError?

A.S.:问题是关于错误的类型,而不是关于现象"usestrict"如果NaN和undefined等系统变量发生更改,则会抛出TypeError。但为什么是类型错误呢?为什么不是语法错误?编辑:实际上,这里不是SyntaxError,因为代码段的语法没有错误。但错误的根源在于,某些protected对象无法手动更改;所以,很可能是访问错误(我知道没有这样的错误)。那么,为什么访问错误看起来像类型错误? 最佳答案 在ES5中,有6种不同的nativeerrors:EvalErrorThisexceptionisnotcurrently

javascript - 包裹在 setTimeout 中时出现错误 "Cannot read property of undefined"

这个问题在这里已经有了答案:Passcorrect"this"contexttosetTimeoutcallback?(6个答案)关闭6年前。我一直在编写一段代码,旨在处理单个网页上的多个小视频元素,但我无法使多个进度条与其各自的视频同步。(CurrentjsFiddleprototype)这段代码$(this).find("progress").attr("value",$("video",this)[0].currentTime);似乎有效在主函数中,但是当我用setTimeout将它包装在另一个函数中时,进度条实际上是动画的,我得到了这个错误:"Cannotreadpropert