jjzjj

TypeError

全部标签

javascript - TypeError : Object(. ..) 不是函数 reactjs

我试图通过将fillCalendar()从组件的方法中提取到它自己的js文件中并导入它来清理这个react组件。最初this.state.datesArray是在componentWillMount()生命周期方法中设置的。现在我试图在构造函数中直接初始化它,因为这就是react文档recommends.现在这样做会抛出“TypeError:Object(...)isnotafunction”错误,我不知道为什么。这是Calendar.js使用的样子seehere.日历.jsimportReact,{Component}from'react';import{fillCalendar}f

javascript - 当我们可以抛出 TypeErrors 时,为什么我们需要 NaN 值?

为什么编程语言有一个NaN值?Math.floor('string');//-->NaN为什么不直接抛出TypeError呢?TypeError:Expectednumberinsteadofstring问题被标记为javascript和language-agnostic因为JavaScript是我最熟悉的语言,但我知道这也适用于其他语言。 最佳答案 在类型化语言中,您必须将数字放入数字变量中,即使您没有数字也是如此。你把NaN(这就是为什么typeofNaN在JavaScript中是“number”的原因)。当您没有更好的对象引用

javascript - TypeError: jQuery(...).on 不是一个函数

伙计们,我从wordpress插件中获得了这个功能:jQuery('#widget-twitter-__i__-username').on('change',function(){jQuery('#widget-twitter-__i__-list').val(0);});jQuery('#widget-twitter-__i__-list').on('change',function(){jQuery('#widget-twitter-__i__-username').val(0);});我得到的错误是:TypeError:jQuery(...).onisnotafunction当我

javascript - 全日历 v2 错误 : Uncaught TypeError: Cannot read property 'month' of undefined

我在添加事件时使用了选择回调。以下代码在v1中有效,但我在v2中遇到了UncaughtTypeError。当我删除ajax代码时没有错误,但我当然需要将新事件添加到数据库中。select:function(start,end,jsEvent,view){vartitle='Available';vareventData;eventData={title:title,start:start};$.ajax({type:'POST',url:'add-event.php',data:eventData,success:function(data){$('#calendar').fullCa

javascript - Google Web Search API 自定义搜索抛出 TypeError

我们的网站上有一个自定义搜索栏,我注意到有时(9/10次)JS会抛出此错误,这会强制您搜索的内容无法呈现www.googleapis.com/customsearch/v1element?key=AIzaSyCVAXiUzRYsML1Pv6RwSG1gu…oogle.com&callback=google.search.Search.apiary####&nocache=1446053383742:2UncaughtTypeError:google.search.Search.apiary####isnotafunction抛出错误时的搜索页面:错误chop/解决的搜索页面但如果我要刷

javascript - 未捕获的 TypeError : element. removeClass 不是 Jquery 中的函数

这个问题在这里已经有了答案:JQuery-object.idisundefinedwhenitshouldn'tbe(2个答案)关闭6年前。我用这个Sample对于验证我的表单,但出现此错误:未捕获的类型错误:element.removeClass不是函数说removeClass()不是函数!!我很困惑我的Js代码:$(function(){varform=$('#CompanyStep'),formData=$.data(form[0]),settings=formData.validator.settings,oldErrorPlacement=settings.errorPlac

javascript - "TypeError: this is not a typed array.with"Node.js 中的 WS.js

我的服务器文件中只有这个,出现错误:constWebSocket=require('ws');constwss=newWebSocket.Server({port:9000});wss.broadcast=functionbroadcast(data){wss.clients.forEach(functioneach(client){if(client.readyState===WebSocket.OPEN){client.send(data);}});};wss.on('connection',functionconnection(ws){ws.on('message',functi

javascript - 错误 : TypeError: window. attachEvent 不是函数

我在我的jsp中使用了custome.js、PIE.js和jquery1_7_2.js文件>/p>这是我的custome.js,仅此而已。jQuery(document).ready(function(){jQuery(function(){if(window.PIE){jQuery('#login-box,.sign-button,.new-user-btn,.grey-btn,.code-btn,#contact-email,#contact-email.continue,#contact-email.cancel').each(function(){PIE.attach(this

javascript - Uncaught TypeError : this. y.rangeBand 不是迁移到 D3 版本 4 后的函数

我正在尝试将我的代码从D3版本3迁移到版本4。这是我的版本3的代码:this.x=d3.scale.linear().range([0,this.width]);this.y=d3.scale.ordinal().rangeRoundBands([-20,this.yItemsHeight],.1,1);this.xAxis=d3.svg.axis().scale(this.x).orient("top");this.yAxis=d3.svg.axis().scale(this.y).orient("left");...this.svg.selectAll(".bar").data(d

javascript - AngularJS: "TypeError: undefined is not a function"与 routeProvider

我正在尝试追踪AngularJS中的“TypeError:undefinedisnotafunction”错误。如果您有任何想法,甚至更好,关于如何调试此类内容的建议,我将不胜感激。请注意,这与我正在处理的代码非常相似,但并不完全相同(尽管它在运行时仍然有相同的错误)。追踪:TypeError:undefinedisnotafunctionatupdate(http://localhost:63342/Channels/vendor/angular-route.js:838:13)atScope.$broadcast(http://localhost:63342/Channels/ve