草庐IT

not_a_rect_shape

全部标签

javascript - Angular - TypeError : XX is not a function

也许我缺少某种属性,但我正在关注这个project我在我的Controller中收到此错误。TypeError:loginService.signinisnotafunction这是我的controller.jsangular.module('appcontrollers',[]).controller('LoginController',['$rootScope','$scope','$http','$location','$localStorage','loginService',function($rootScope,$scope,$http,loginService){$sco

javascript - React.js 和 ES6 : Any reason not to bind a function in the constructor

我正在将React组件更新为ES6,遇到了这个问题中描述的问题-UnabletoaccessReactinstance(this)insideeventhandler-即不绑定(bind)到组件实例。这是有道理的,当然也行得通,但我对答案的另一部分感到困惑:Beawarethatbindingafunctioncreatesanewfunction.Youcaneitherbinditdirectlyinrender,whichmeansanewfunctionwillbecreatedeverytimethecomponentrenders,orbinditinyourconstru

IE8 中的 Javascript 错误 : Not implemented

这个真的让我很困惑,因为代码看起来完全无害。IE8停止脚本执行并显示一条消息:Notimplemented.map.jsline:66char:5这是代码片段:63if(data.map[x]!==undefined&&data.map[x][y]!==undefined){6465left=(x-data.dim.x_min)*32+30;66top=(data.dim.y_max-y)*32+30;6768/*dostuff*/XX}调试信息:x:263data.dim.x_min:263y:172data.dim.y_max:174数据是从JQueryAjax调用返回的对象。这适

javascript - 如何解决 JSLint 警告 "Do not use ' new' for side effects”?

为什么会出现这些错误?第329行第60行的问题:不要使用'new'作为副作用。newwidget.StyledDropdown(dojo.byId("sTitle"));第330行第61行的问题:不要使用'new'作为副作用。newwidget.StyledDropdown(dojo.byId("sSuffix"));第336行第57行的问题:不要使用'new'作为副作用。true,{shortenName:true,maxChars:20});第338行第129行的问题:不要使用'new'作为副作用。newwidget.StyledDropdown(dojo.byId("sCount

javascript - 错误 : [ng:areq] Argument 'MyCtrl' is not a function, 未定义

我是Angularjs的新手,我正在学习教程,但我在标题中遇到了错误。HTML代码:IDNameSurnameHouseAddressLocalityContactContact2Contact3ReplyEdit{{person.ID}}{{person.Name}}{{person.Surname}}{{person.House}}{{person.Address}}//DefiningaAngularmodulevarmyApp=angular.module('myApp',[]);//DefiningaAngularControllermyApp.controller('MyC

javascript - Youtube Iframe : onYouTubePlayerAPIReady() not called

我有一个带有iframe的页面,它加载了一个youtube视频(iframe的src在运行时被修改)。我基于RobW在有关此主题的不同答案中提供的代码然后,当加载iframe时,将执行以下代码:$('.browser').load(function(){dispose_ytplayer();});调用的函数dispose_ytplayer()是:functiondispose_ytplayer(){(function(){vars=document.createElement("script");s.src="http://www.youtube.com/player_api";var

javascript - Uncaught ReferenceError : app is not defined in Angularjs

我遇到了这个错误。我查看了之前发布的答案,但仍然遇到同样的问题。index.htmlVizavoo应用程序.js(function(){varapp=angular.module('customersApp',['ngRoute']);app.config(['$routeProvider',function($routeProvider){$routeProvider.when('/login',{title:'Login',controller:'loginController',templateUrl:'app/views/loginuser.html'}).when('/log

javascript - 未捕获的类型错误 : undefined is not a promise

我得到了错误UncaughtTypeError:undefinedisnotapromiseconstp=Promise((resolve,reject)=>{resolve('ok')})p.then(resp=>console.log(resp))https://jsbin.com/daluquxira/edit?js,console,output上面的代码有什么问题? 最佳答案 您需要实例化Promise。在这种情况下:constp=newPromise((resolve,reject)=>{resolve('ok')})p.

javascript - Uncaught ReferenceError : stopme is not defined (anonymous function)

我一直在我的控制台中看到这个非破坏性异常:UncaughtReferenceError:stopmeisnotdefined(匿名函数)在我的任何文件中都没有调用名为stopme的变量,在控制台中进行了全面搜索。我有多个:setInterval(function(){updateMetrics();},1000);调用我的代码,每当其中一个失败时,它就会显示在控制台中。我也不知道这是否是默认行为,但我也注意到每次我使用以下方法设置新间隔时:varintervalId=setInterval(function(){},1000);intervalId是非顺序的,如:console.log

javascript - setTimeOut 是未捕获的 ReferenceError : setTimeOut is not defined

关闭。这个问题是notreproducibleorwascausedbytypos.它目前不接受答案。这个问题是由于错别字或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这个问题的解决方式不太可能帮助future的读者。关闭8年前。Improvethisquestion首先,我是javascript的新手,我在setTimeOut中遇到了问题......这是我的脚本代码.......$('#navullia').hover(function(){$(this).next("div").slideDown("fast").siblings("div").slideU