草庐IT

invalid-argument

全部标签

javascript - this.initialize(arguments) 与 this.initialize.apply(this, arguments) : what's the difference?

如果您查看Backbone.js的源代码,您会看到此模式的多种用途:this.initialize.apply(this,arguments);例如,这里:varRouter=Backbone.Router=function(options){options||(options={});if(options.routes)this.routes=options.routes;this._bindRoutes();this.initialize.apply(this,arguments);};为什么不直接写this.initialize(arguments)呢?

javascript - IE11 上的 "Error: Invalid argument."

我在IE11上的Angular1.5.7中收到下面列出的错误。Angular不会在Chrome上抛出任何错误。我尝试了以下方法:我看到帖子暗示这与内插值有关,例如“{{model.label}}”,所以我添加了一个ng-if,但它没有帮助。已升级到最新的Angular:1.5.7。升级了jquery,因为我看到错误堆栈中列出了它。Error:Invalidargument.atinterpolateFnWatchAction(http://localhost:8080/mdp-js/app/assets/angular/angular.js:9621:17)atinterpolateF

javascript - Angular AOT : ERROR in ng component html file : Expected 0 arguments, 但得到 1

最初我在发布angular.net核心SPA应用程序时遇到以下错误:Can'tresolverxjs/operatorsinrelease\directives我已经通过将rxjs版本更新到5.6解决了这个问题。现在在发布应用程序时出现以下错误:WARNINGinEnvironmentPlugin-NODE_ENVenvironmentvariableisundefined.Youcanpassanobjectwithdefaultvaluestosuppressthiswarning.Seehttps://webpack.js.org/plugins/environment-plug

javascript - Heroku "Invalid Host header"HOST 配置中的 ReactJS APP?

我正在尝试将我的Reactapp在Heroku上。整个项目包括一个API(express)和一个客户端(ReactJS)。我已将我的API放在heroku上。但是当我把我的客户端放在Heroku上时,它显示构建成功。但是当我open它,它显示InvalidHostheader。我用谷歌搜索了这个问题,很多人告诉我配置HOST.但是他们正在使用webpack。我使用create-react-app构建它,并通过npmstart运行它。我想知道如何以最简单的方式解决这个问题。谢谢。 最佳答案 如果出于任何原因您试图在没有服务器的情况下部

JavaScript element.classList.add ("fa fa-hand-rock-o") 错误 : "String contains an invalid character"

我正在尝试添加一个类使用:document.getElementById("sp1").classList.add("fafa-hand-rock-o");但是显示错误:Stringcontainsaninvalidcharacter 最佳答案 fafa-hand-rock-o不能是单个类,因为类名不能有空格。这里我假设您正在尝试添加两个不同的类。使用classList.add()添加多个类时,将所有类指定为单独的逗号分隔字符串,如:.add("fa","fa-hand-rock-o")代码示例:document.getElemen

javascript - IE9 抛出 DOM 异常 : INVALID_CHARACTER_ERR (5)

在下面的脚本中,IE9会抛出一个错误:SCRIPT5022:DOM异常:INVALID_CHARACTER_ERR(5)mootools-1.2.1-core-yc.js,第118行字符1Document.implement({newElement:function(A,B){if(Browser.Engine.trident&&B){["name","type","checked"].each(function(C){if(!B[C]){return;}A+=""+C+'="'+B[C]+'"';if(C!="checked"){deleteB[C];}});A="";}return

javascript - KendoGrid JavaScript 运行时错误 : Invalid template

试图弄清楚Kendo世界并在将网格设置为json数组数据源时遇到问题。Erroris"JavaScriptruntimeerror:Invalidtemplate:#=data.AccountNum==null?'':data.AccountNum#...".我注意到在这个错误中我看到了空值,想知道这是否意味着数据没有绑定(bind)?但是我看到了列标题,只是没有看到任何行。我还必须提到,我的数据中没有任何ID字段,因为我使用的是SQLView中的临时表。functionpopulateGrid(search){$("#grdAttributes").kendoGrid({dataSo

javascript - Firebase promise - Query.once 失败 : Was called with 1 argument. 预计至少 2

我正在尝试使用promises将来自Firebase的一些数据填充到一个数组中。这是数据库结构:-domainname(orsomething)|--highscore|--Foo:50|--Bar:60代码:vararr=[];highscoreRef.child('highscore').once('value').then(function(snapshot){snapshot.forEach(function(data){arr.push({playerName:data.key(),score:data.val()});});},function(error){console

Javascript:DOM 异常:INVALID_CHARACTER_ERR (5)

我使用新的IE9测试了我的网站,但我收到错误消息INVALID_CHARACTER_ERR(5)。在IE9中,开发人员工具突出显示了这一行。谁能帮我解决这个错误?错误行this.iframe=document.createElement('');FunctionCode__createDivs:function(){this.divs_transparentDiv=document.createElement('DIV');this.divs_transparentDiv.className='modalDialog_transparentDivs';this.divs_transpa

javascript - Google Closure 编译器解析错误 : invalid property id for `css({float:' left'})`

我正在使用GoogleClosureCompiler应用程序(命令行界面)。当我运行它时,出现以下错误。deploy/js/Home.js:40:ERROR-Parseerror.invalidpropertyidthis.$images.wrapAll('').css({float:'left'});^1error(s),0warning(s) 最佳答案 我相信你需要做:{'float':'left'}这是因为float在listofJavakeywordsreservedbyJavaScript上,因此它不能用作属性名称。这在较