草庐IT

argument-passing

全部标签

javascript - Bootbox 4.1.0 : how to pass localized strings such as Ok, 取消Bootbox的确认?

在Bootbox3.2.0中,我能够使用如下传递的字符串进行确认:bootbox.confirm(confirm_string,cancel_string,yes_string,function(r){if(r){//dosomething}});我正在升级到4.1.0,但在调用上述函数时遇到错误。根据Bootbox4.1.0的文档(http://bootboxjs.com/documentation.html),调用confirm的方法有两种:bootbox.confirm(strmessage,fncallback)bootbox.confirm(objectoptions)我用消

javascript:将对象作为参数传递给字符串内的onclick函数

我想将一个对象作为参数传递给字符串内的Onclick函数。类似以下内容:functionmyfunction(obj,parentobj){varo=document.createElement("div");o.innerHTML='';parentobj.appendChild(o.firstChild);}显然,这是行不通的。有人知道吗?谢谢!如@Austin所建议的更完整的版本testfunctiontest(s){document.getElementById("test").innerHTML+=s;}functionsomelistener(obj){test(obj.i

javascript - 尝试使用 gh-pages 部署我的 React 应用程序但收到此错误消息 : The "file" argument must be of type string. Received type undefined

我试图用gh-pages部署我的React应用程序,但我遇到了这个错误:"file"参数必须是字符串类型。接收类型未定义。起初,我以为这是我的代码,所以我制作了另一个没有修改的create-react-app,尝试使用npmrundeploy命令进行部署,但再次收到此错误消息。我的package.json(我添加了我的homepage链接、predeploy和deploy脚本,以及gh-页面依赖):"name":"test-deploy","version":"0.1.0","private":true,"homepage":"https://vnsteven.github.io/te

javascript - Backbone : Correct way of passing 'this' reference to anon functions in success/error callbacks

给定下面的主干View函数,将this(即当前View)传递给回调中定义的匿名函数的正确方法是什么?addSomething:function(e){varnewSomething=this.model.somethings.create({someProperty:xxx},{success:function(m,response){this.doSomething();//***HERE****},error:function(m,response){//Error}});},没有和变化,anon函数中的this设置为window。我可以这样设置一个引用:varthisView=t

c# - SCRIPT87 : Invalid argument in IE 9, ASP.NET C#

这适用于除IE以外的所有其他浏览器。我在C#中的代码中建立一个链接:stringlink=OpenPopUpWindow这是我的javascript函数:functionMyfunction(pMyString){CloseWindow();varurl="DomainPath/MyPage.aspx?Site="+pMyString;win=window.open(url,"ManageDomain",'toolbar=no,location=no,status=no,directories=no,scrollbars=yes,resizable=no,width='+700+',h

javascript - 为什么我在 IE : "The data area passed to a system call is too small"? 中收到此错误

我正在使用Javascript创建一个供下载的csv文件,它在除IE(我已经测试过8和10)之外的所有文件中都运行良好。在IE8中,当我单击创建和下载文件的按钮时,我收到一条错误消息,提示“传递给系统调用的数据区域太小”。在IE10中,当我单击该按钮时,它只会打开一个新选项卡,其中包含我在地址栏中创建的URL,但不会下载任何内容。知道这个错误是什么意思吗?我在按钮中有这段代码:varcsvContent="data:text/csv;charset=utf-8,";csvContent+=escape(myCSVvariable);varencodedUri=encodeURI(csv

javascript - AngularJS 延迟错误 : Argument 'fn' is not a function, 得到对象

我试图让我的应用程序在更改路线之前收集数据,如JohnLindquist的许多视频所示:http://www.youtube.com/watch?v=P6KITGRQujQ&list=UUKW92i7iQFuNILqQOUOCrFw&index=4&feature=plcp我已将其全部连接起来,但是当需要解析延迟对象时,我收到错误消息:Error:Argument'fn'isnotafunction,gotObjectatassertArg(http://localhost:9000/components/angular/angular.js:1019:11)atassertArgFn

php - MSSQL 和 PHP : "An invalid parameter was passed to sqlsrv_query."

我试图通过PHP运行一个非常简单的MSSQL更新语句,但我收到一条错误消息*“将无效参数传递给sqlsrv_query。”*这是connectionclass我正在使用,最相关的是查询功能:functionquery($query){$result=sqlsrv_query($query)ordie(print_r(sqlsrv_errors(),true));}最后,这是我用来尝试执行语句的代码:$db=newmssqlClass();$conn=$db->connect();$SQL="UPDATEtableSETTitle='Test'whereID=1"$SQL=$db->qu

php - Laravel 验证 : required_with_all condition always passing

根据laravelvalidationdocumentation:required_with_all:foo,bar,...Thefieldundervalidationmustbepresentonlyifalloftheotherspecifiedfieldsarepresent.这是我的测试:Route::get('/test/{param}',function($param){$screenRules=array('foo'=>'string','param'=>'required_with_all:foo',);$validator=Validator::make(array

php - 为什么PhpStorm会报 "Argument type does not match"错误?

我正在使用PhpStorm10.0.2开发一个PHP7项目。每当我为函数参数声明PHPDoc@param时,该参数具有标量类型的类型提示(string、int、...)我收到这个警告:Argumenttypedoesnotmatch这是PhpStorm提示的一些示例代码:classHostConfig{/***@varstring*/private$hostname;/***@varstring*/private$domainname;/***CreatesanewinstanceofhteHostConfigmodel.**@paramstring$hostnameAhostname