草庐IT

undefine

全部标签

javascript - app.configure(function){} typeerror undefined is not a function

我正在使用socket.io和angularjs创建一个聊天应用程序,当我使用cmd运行app.js文件时,我收到一条错误消息“app.configure(function){}typeerrorundefinedisnotafunction”可能是什么问题?我的代码是这样的:varhttp=require('http');varexpress=require('express'),routes=require('./routes'),socket=require('./routes/socket.js');app=module.exports.app=express();varser

javascript - 使用 map 时 react 'cannot read property of undefined'

我正在从teamtreehouse.com制作一个非常基本的React应用程序,并且我经常遇到"TypeError:Cannotreadproperty'onPlayerScoreChange'ofundefined"即使我正确地绑定(bind)了我的函数(我认为)'onPlayerScoreChange'是Grandparent组件中的一个方法,当用户点击“+”或“-”按钮更改玩家得分时执行。如果有人能解释出什么问题,那将非常有帮助,因为我想我在曾祖parent的构造函数中设置了this.onPlayerScoreChange=this.onPlayerScoreChange.bin

javascript - 来自 prototype.js 第 3877 行的 "undefined handler"

一个非常小众的问题:我有时(30%的时间)在prototype.js库(来自google的版本1.6.0.2:http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js)的第3877行收到“未定义的处理程序”javascript错误。现在在这个页面上我有一个谷歌地图,我使用原型(prototype)窗口库。问题出现在IE7和FF3中。这是FireBug提供的信息:handlerisundefined?inprototype.js@3871()prototype.js(line3877)handler.call(

javascript - Angularjs/ ionic 类型错误 : Cannot read property 'then' of undefined

代码:js:angular.module('starter.services',['ngResource']).factory('GetMainMenu',['$http','$q','$cacheFactory',function($http,$q,$cacheFactory){varmethodStr='JSONP';varurlStr='http://localhost/bd/wp-admin/admin-ajax.php';varptStr={action:'bd_get_main_menus',callback:'JSON_CALLBACK'};return{getMainM

javascript - Typescript - null 和 undefined 之间有什么区别?

这个问题在这里已经有了答案:WhatisthedifferencebetweennullandundefinedinJavaScript?(38个答案)关闭5年前。我想知道typescript中null和undefined的区别。我知道在javascript中可以同时使用它们来检查变量是否没有值。但是在typescript中,我想知道确切的区别以及何时最好使用它们中的每一个。谢谢。

javascript - 为什么要重用 `undefined` ?

这个问题在这里已经有了答案:HowdoesthisJavaScript/jQuerysyntaxwork:(function(window,undefined){})(window)?(5个答案)Nextparameteris'undefined'injQuery,why?[duplicate](3个答案)关闭9年前。在JohnResig'sslideshow在谈到他如何构建jQuery1.4时,他提到了一点,他在jQuery闭包中添加了一个undefined变量,因为“我们可以重用(变量)”。undefined不是普通变量:>varundefined=4undefined>undef

javascript/youtube api - undefined variable YT

我正在创建一个通过YTapi嵌入的YouTube播放器,但我不断收到一个警告,提示变量YT未定义。我可以看到包含了youtubeAPI的脚本,它应该创建变量YT-为什么这不起作用?它适用于我网站的其他地方。这是链接:http://oncreativity.tv/site/single/4/7CtQaTmEuWk和我的代码:$(document).ready(function(){vartag=document.createElement('script');tag.src="http://www.youtube.com/player_api";varfirstScriptTag=doc

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

jQuery(document).ready(function(){//alert("HIQ");$('.mySelectCalendar').datepicker({firstDay:1,dateFormat:"dd.mm.yy"});$.validator.addMethod('date',function(value,element,params){if(this.optional(element)){returntrue;};varresult=false;try{$.datepicker.parseDate('dd.mm.yy',value);result=true;}cat

javascript - React js map() undefined 不是一个函数

我是React的新手,我有点疯狂地想弄清楚我做错了什么。我正在尝试遍历从ajax调用中获得的json数组。当我模拟数据时它完美地工作,但是当我进行ajax调用以获取完全相同的数据时它给我undefinedisnotafunction(evaluating'this.state.list.map()')数组:[{“名称”:“drop1”},{“名称”:“drop2”},{“名称”:“drop3”}]函数:varList=React.createClass({getInitialState:function(){return{data:{}};},componentDidMount:fun

javascript - KnockoutJS fromJS 不工作 TypeError : Cannot call method 'fromJS' of undefined

我使用knockoutJS,当我使用“fromJS”时出现以下错误TypeError:Cannotcallmethod'fromJS'ofundefined我的JavaScript代码$(document).ready(function(){varPersonModel=function(data){ko.mapping.fromJS(data,{},this);};vardata=$.getJSON("http://localhost:40913/candidate/index/1",function(data){viewModel=newPersonModel(data);ko.a