草庐IT

illegal_argument_excep

全部标签

javascript - Angular 在 IE 中抛出 "Error: Invalid argument."

我有一个指令,它接受元素的文本并放置wbr每10个字符后的元素。例如,我在具有长文本(例如URL)的表格单元格上使用它,因此它不会跨越表格。指令代码:myApp.directive('myWbr',function($interpolate){return{restrict:'A',link:function(scope,element,attrs){//gettheinterpolatedtextofHTMLelementvarexpression=$interpolate(element.text());//getnewtext,whichhaselementonevery10th

javascript - $.ajax 抛出奇怪的 "Uncaught TypeError: Illegal invocation"

我有一些jQuery代码抛出了一个非常奇怪的错误。谷歌浏览器调用错误UncaughtTypeError:Illegalinvocation并说它被抛出在jquery-1.4.4.min.js第144行的c.extend.param.e中,但回溯到我的$.ajax调用,看起来像这样:$.ajax({url:target,type:method,dataType:'json',data:sendData,success:function(result){if(result.redirect){window.location=result.redirect;}else{for(variinr

javascript - 为什么 JavaScript Arguments 对象会因赋值给参数而发生变化?

这种行为背后的基本原理是什么?functionf(x){console.log(arguments[0]);x=42;console.log(arguments[0]);}f(1);//=>1//=>42也许这是一个真正的错误。ECMAScript规范的哪一部分定义了这种行为? 最佳答案 实际上,在严格模式下,这不会发生为youcanseehere.如果您阅读ECMAStandard的第10.6节,特别是注释1,您会看到:Fornon-strictmodefunctionsthearrayindex(definedin15.4)na

javascript - 未捕获的类型错误 : Illegal invocation on addEventListener

我得到了一个UncaughtTypeError:Illegalinvocation对于这个试图放下EventListener的两个版本:(我在应该添加监听器时收到错误,而不是在我点击目标时收到错误)ronan.addEventListener("click",alert,false);addEventListener.apply(ronan,["click",alert,false]);ronan是控制台成功返回的div元素,所以我认为这不是问题所在。为什么我会收到此错误的任何想法?我读了this线程,我无法从中弄清楚。 最佳答案

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

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 - 未能构造通知 : Illegal constructor

我的网站使用从未在移动设备上运行过的桌面通知,但我最近开始在Android4.4上的Chrome版本42.0.2311.108中收到以下异常:Failedtoconstruct'Notification':Illegalconstructor.UseServiceWorkerRegistration.showNotification()instead.TypeError:Failedtoconstruct'Notification':Illegalconstructor.UseServiceWorkerRegistration.showNotification()instead.我的通

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 - 为什么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

php - 警告 : Illegal string offset 'id'

这个问题在这里已经有了答案:IllegalstringoffsetWarningPHP(17个答案)关闭9年前。我定义了两个变量如下:$pic=get_tax_meta($books->term_id,'books_field_id',true);$imageurl=wp_get_attachment_image_src($pic[id],'list-thumb');print_r($pic)结果如下:Array([id]=>302[src]=>http://localhost/mysite/wp-content/uploads/2013/10/apic.jpg)但是,我从$pic[i